<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 1:59 AM, <span dir="ltr"><<a href="mailto:shazeb@multicorewareinc.com" target="_blank">shazeb@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Shazeb Nawaz Khan <<a href="mailto:shazeb@multicorewareinc.com">shazeb@multicorewareinc.com</a>><br>
# Date 1382597911 -19800<br>
# Thu Oct 24 12:28:31 2013 +0530<br>
# Node ID 207ddd54cdbcd516076d31a98ae6b5c6f4942e46<br>
# Parent 0cb0692d6c69dbf6c5b49c51f6f528e29674baa9<br>
Displaying the number of weighted P frames used in console log<br></blockquote><div><br></div><div>Queued for stable</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/Lib/TLibCommon/TComSlice.cpp<br>
--- a/source/Lib/TLibCommon/TComSlice.cpp Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/Lib/TLibCommon/TComSlice.cpp Thu Oct 24 12:28:31 2013 +0530<br>
@@ -125,6 +125,7 @@<br>
m_enableTMVPFlag = true;<br>
m_ssim = 0;<br>
m_ssimCnt = 0;<br>
+ m_numWPRefs = 0;<br>
}<br>
<br>
bool TComSlice::getRapPicFlag()<br>
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/Lib/TLibCommon/TComSlice.h<br>
--- a/source/Lib/TLibCommon/TComSlice.h Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/Lib/TLibCommon/TComSlice.h Thu Oct 24 12:28:31 2013 +0530<br>
@@ -1375,8 +1375,9 @@<br>
<br>
public:<br>
<br>
- MotionReference * m_mref[2][MAX_NUM_REF + 1];<br>
- wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]<br>
+ MotionReference *m_mref[2][MAX_NUM_REF + 1];<br>
+ wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]<br>
+ int m_numWPRefs; // number of references for which unidirectional weighted prediction is used<br>
<br>
/* SSIM values per frame */<br>
double m_ssim;<br>
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/encoder/encoder.cpp Thu Oct 24 12:28:31 2013 +0530<br>
@@ -94,6 +94,7 @@<br>
m_lookahead = new Lookahead(this, m_threadPool);<br>
m_dpb = new DPB(this);<br>
m_rateControl = new RateControl(this);<br>
+ m_numWPFrames = 0;<br>
}<br>
<br>
void Encoder::destroy()<br>
@@ -249,6 +250,8 @@<br>
pic_out->stride[2] = recpic->getCStride();<br>
}<br>
<br>
+ if (out->getSlice()->m_numWPRefs > 0)<br>
+ m_numWPFrames++;<br>
uint64_t bits = calculateHashAndPSNR(out, nalunits);<br>
// Allow this frame to be recycled if no frame encoders are using it for reference<br>
ATOMIC_DEC(&out->m_countRefEncoders);<br>
@@ -294,6 +297,12 @@<br>
m_analyzeAll.printOut('a', fps);<br>
}<br>
<br>
+ if (param.bEnableWeightedPred)<br>
+ {<br>
+ int numPFrames = m_analyzeP.getNumPic();<br>
+ x265_log(¶m, X265_LOG_INFO, "%d of %d (%.2f%%) P frames weighted\n", m_numWPFrames, numPFrames, (float) 100.0 * m_numWPFrames / numPFrames);<br>
+ }<br>
+<br>
#if _SUMMARY_OUT_<br>
m_analyzeAll.printSummaryOut(fps);<br>
#endif<br>
@@ -326,6 +335,7 @@<br>
stats->globalSsim = 0;<br>
stats->globalPsnr = 0;<br>
}<br>
+ stats->totalWPFrames = m_numWPFrames;<br>
}<br>
<br>
#define VERBOSE_RATE 0<br>
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/encoder/encoder.h<br>
--- a/source/encoder/encoder.h Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/encoder/encoder.h Thu Oct 24 12:28:31 2013 +0530<br>
@@ -69,6 +69,9 @@<br>
// quality control<br>
TComScalingList m_scalingList; ///< quantization matrix information<br>
<br>
+ // weighted prediction<br>
+ int m_numWPFrames; // number of Unidirectional weighted frames used<br>
+<br>
public:<br>
<br>
x265_nal_t *m_nals;<br>
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/encoder/frameencoder.cpp Thu Oct 24 12:28:31 2013 +0530<br>
@@ -426,7 +426,10 @@<br>
{<br>
TComPicYuv *recon = slice->getRefPic(list, ref)->getPicYuvRec();<br>
if ((slice->isInterP() && slice->getPPS()->getUseWP()))<br>
+ {<br>
w = slice->m_weightPredTable[list][ref];<br>
+ slice->m_numWPRefs++;<br>
+ }<br>
slice->m_mref[list][ref] = recon->generateMotionReference(w);<br>
}<br>
}<br>
diff -r 0cb0692d6c69 -r 207ddd54cdbc source/x265.h<br>
--- a/source/x265.h Wed Oct 23 20:09:33 2013 +0800<br>
+++ b/source/x265.h Thu Oct 24 12:28:31 2013 +0530<br>
@@ -241,6 +241,7 @@<br>
double globalSsim;<br>
double accBits;<br>
uint32_t totalNumPics;<br>
+ uint32_t totalWPFrames; /* Total number of Uni-directional weighted frames used */<br>
}<br>
x265_stats_t;<br>
<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>