<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:#000000">Please, ignore this patch. Thanks.</div><div class="gmail_default" style="font-family:georgia,serif;color:#000000"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 17, 2016 at 8:51 PM, <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@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 Praveen Tiwari <<a href="mailto:praveen@multicorewareinc.com">praveen@multicorewareinc.com</a>><br>
# Date 1479128885 -19800<br>
# Mon Nov 14 18:38:05 2016 +0530<br>
# Branch stable<br>
# Node ID 8defd4e7b2e4875247e4ec95e0dd3b<wbr>9630983526<br>
# Parent bdf273f9521784ceeda868222d4153<wbr>03a0bcf58b<br>
pcs: update design to have 'm_achivedFps' for every PCS Instance<br>
<br>
diff -r bdf273f95217 -r 8defd4e7b2e4 source/api-uhdkit.cpp<br>
--- a/source/api-uhdkit.cpp Tue Nov 08 14:20:24 2016 +0530<br>
+++ b/source/api-uhdkit.cpp Mon Nov 14 18:38:05 2016 +0530<br>
@@ -206,8 +206,6 @@<br>
return -1;<br>
if (numEncoded > 0)<br>
{<br>
- uhdkitEnc->m_achievedFps = numEncoded * 1000000.0 / (double)(endTime - startTime);<br>
- uhdkitEnc->m_achievedFps = uhdkitEnc->m_achievedFps / uhdkitEnc->m_param->gops; // Achieved fps for each gop encoder<br>
uhdkitEnc->m_encodedFrameCount += numEncoded;<br>
controllerIndex = ((uhdkitEnc->m_<wbr>encodedFrameCount - 1) / uhdkitEnc->m_param->x265Param-<wbr>>keyframeMax) % uhdkitEnc->m_param->gops;<br>
X265_CHECK(controllerIndex >= 0 && controllerIndex < uhdkitEnc->m_param->gops, "Invalid controllerIndex: %d, must be between 0 and %d\n", controllerIndex, uhdkitEnc->m_param->gops);<br>
diff -r bdf273f95217 -r 8defd4e7b2e4 source/pcs/api-pcs.cpp<br>
--- a/source/pcs/api-pcs.cpp Tue Nov 08 14:20:24 2016 +0530<br>
+++ b/source/pcs/api-pcs.cpp Mon Nov 14 18:38:05 2016 +0530<br>
@@ -211,6 +211,7 @@<br>
m_pcsParam-><wbr>statusPrintInterval = param->statusPrintInterval;<br>
m_curTimeStamp = m_lastTimeStamp = X265_NS::x265_mdate();<br>
m_framesWindow = 1;<br>
+ m_achievedFps = 0.0;<br>
m_<wbr>outFrameCountOfLastAccumulator<wbr>Reset = 0;<br>
time(&m_lastStatusOutputTime);<br>
<br>
@@ -289,11 +290,11 @@<br>
int64_t elapsedEncTime = m_curTimeStamp - m_lastTimeStamp;<br>
int controllerIndex = ((uhdkitEnc->m_<wbr>encodedFrameCount - 1) / uhdkitEnc->m_param->x265Param-<wbr>>keyframeMax) % uhdkitEnc->m_param->gops;<br>
X265_CHECK(controllerIndex >= 0 && controllerIndex < uhdkitEnc->m_param->gops, "Invalid controllerIndex: %d, must be between 0 and %d\n", controllerIndex, uhdkitEnc->m_param->gops);<br>
- if (((m_bScenecut == 1) && elapsedEncTime > 0) || elapsedEncTime >= 300000 || uhdkitEnc->m_achievedFps < m_pcsParam->fpsSetPoint)<br>
+ if (((m_bScenecut == 1) && elapsedEncTime > 0) || elapsedEncTime >= 300000 || m_achievedFps < m_pcsParam->fpsSetPoint)<br>
{<br>
// Don't allow outrageously high frame rate measurements to skew the controller.<br>
- uhdkitEnc->m_achievedFps = X265_MIN(uhdkitEnc->m_<wbr>achievedFps, 4 * m_pcsParam->fpsSetPoint);<br>
- error = (m_pcsParam->fpsSetPoint - uhdkitEnc->m_achievedFps) / m_pcsParam->fpsSetPoint;<br>
+ m_achievedFps = X265_MIN(m_achievedFps, 4 * m_pcsParam->fpsSetPoint);<br>
+ error = (m_pcsParam->fpsSetPoint - m_achievedFps) / m_pcsParam->fpsSetPoint;<br>
<br>
if (m_pcsParam->integralReset > 0)<br>
{<br>
@@ -308,7 +309,7 @@<br>
{<br>
double lowerBound = (m_pcsParam->fpsSetPoint * SATURATION_RANGE_MIN) / 100.0; /* Lower bound, 3% of set-point */<br>
double upperBound = (m_pcsParam->fpsSetPoint * SATURATION_RANGE_MAX) / 100.0; /* Upper bound, 10% of set-point */<br>
- double fpsDiff = (uhdkitEnc->m_achievedFps - m_pcsParam->fpsSetPoint);<br>
+ double fpsDiff = (m_achievedFps - m_pcsParam->fpsSetPoint);<br>
resetErrorAccumulater = (fpsDiff >= lowerBound && fpsDiff <= upperBound) || m_bScenecut; /* Steady state, or scenecut */<br>
}<br>
<br>
@@ -388,7 +389,7 @@<br>
m_<wbr>outFrameCountOfLastAccumulator<wbr>Reset = uhdkitEnc->m_<wbr>encodedFrameCount;<br>
m_lastTimeStamp = m_curTimeStamp;<br>
if (uhdkitEnc->m_reconfigParam-><wbr>logLevel == UHDKIT_LOG_INFO)<br>
- uhdkit_pcs_printStatus(&<wbr>uhdkitEnc->m_reconfigParam[<wbr>controllerIndex], uhdkitEnc->m_achievedFps);<br>
+ uhdkit_pcs_printStatus(&<wbr>uhdkitEnc->m_reconfigParam[<wbr>controllerIndex], m_achievedFps);<br>
}<br>
return true;<br>
}<br>
@@ -398,6 +399,11 @@<br>
m_bScenecut = pic->frameData.bScenecut;<br>
}<br>
<br>
+void pcs::uhdkit_pcs_update_fps(<wbr>int64_t startTime, int64_t endTime, int numEncoded)<br>
+{<br>
+ m_achievedFps = numEncoded * 1000000.0 / (double)(endTime - startTime);<br>
+}<br>
+<br>
int pcs::uhdkit_pcs_<wbr>getControlParamValue(const x265_param *param, int index)<br>
{<br>
int controlParamValue[NUM_<wbr>CONTROLLER] = { param->bEnableFastIntra, param->bEnableEarlySkip, param->bEnableRectInter,<br>
diff -r bdf273f95217 -r 8defd4e7b2e4 source/pcs/pcs.h<br>
--- a/source/pcs/pcs.h Tue Nov 08 14:20:24 2016 +0530<br>
+++ b/source/pcs/pcs.h Mon Nov 14 18:38:05 2016 +0530<br>
@@ -32,6 +32,7 @@<br>
/* variables handled by the PCS Instance */<br>
pcs_param* m_pcsParam;<br>
pcs_controller* m_pcsController;<br>
+ double m_achievedFps;<br>
int64_t m_curTimeStamp;<br>
int64_t m_lastTimeStamp;<br>
time_t m_lastStatusOutputTime;<br>
@@ -52,6 +53,9 @@<br>
/* This function updates the scenecut information */<br>
void uhdkit_pcs_scenecut(x265_<wbr>picture *pic);<br>
<br>
+ /* Update achieved fps */<br>
+ void uhdkit_pcs_update_fps(int64_t startTime, int64_t endTime, int numEncoded);<br>
+<br>
/* Closes all test files */<br>
void uhdkit_pcs_close();<br>
};<br>
diff -r bdf273f95217 -r 8defd4e7b2e4 source/uhdkit-encoder.h<br>
--- a/source/uhdkit-encoder.h Tue Nov 08 14:20:24 2016 +0530<br>
+++ b/source/uhdkit-encoder.h Mon Nov 14 18:38:05 2016 +0530<br>
@@ -35,7 +35,6 @@<br>
cappedvbr *m_cappedVbr;<br>
x265_param* m_reconfigParam; //use if needed, for pcs<br>
int m_encodedFrameCount;<br>
- double m_achievedFps;<br>
<br>
void uhdkitPreprocess(<wbr>uhdkitEncoder* uhdEnc, x265_picture&, int picWidth, int picHeight, int csp);<br>
uhdkitEncoder()<br>
@@ -48,7 +47,6 @@<br>
m_gopParallelEncoder = NULL;<br>
m_cappedVbr = NULL;<br>
m_reconfigParam = NULL;<br>
- m_achievedFps = 0.0;<br>
}<br>
};<br>
}<br>
</blockquote></div><br></div>