<div dir="ltr"><br><div class="gmail_extra">Will resend the patch with necessary changes.<br><div class="gmail_quote">On Wed, Sep 9, 2015 at 1:26 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"><div class="HOEnZb"><div class="h5">On 09/07, <a href="mailto:santhoshini@multicorewareinc.com">santhoshini@multicorewareinc.com</a> wrote:<br>
> # HG changeset patch<br>
> # User Santhoshini Sekar<<a href="mailto:santhoshini@multicorewareinc.com">santhoshini@multicorewareinc.com</a>><br>
> # Date 1441619453 -19800<br>
> # Mon Sep 07 15:20:53 2015 +0530<br>
> # Node ID 2ba81f60f111c12a8f668ece13b23123702f2582<br>
> # Parent 44cc2ce22c43ee04c67f669f2667a6e25747c4f9<br>
> Introduce structure needed for Intra-refresh<br>
><br>
> diff -r 44cc2ce22c43 -r 2ba81f60f111 source/common/framedata.cpp<br>
> --- a/source/common/framedata.cpp Thu Sep 03 22:26:21 2015 +0530<br>
> +++ b/source/common/framedata.cpp Mon Sep 07 15:20:53 2015 +0530<br>
> @@ -43,6 +43,7 @@<br>
><br>
> CHECKED_MALLOC(m_cuStat, RCStatCU, sps.numCUsInFrame);<br>
> CHECKED_MALLOC(m_rowStat, RCStatRow, sps.numCuInHeight);<br>
> + CHECKED_MALLOC(m_pir, PeriodicIR, 1);<br>
> reinit(sps);<br>
> return true;<br>
><br>
> @@ -54,6 +55,7 @@<br>
> {<br>
> memset(m_cuStat, 0, sps.numCUsInFrame * sizeof(*m_cuStat));<br>
> memset(m_rowStat, 0, sps.numCuInHeight * sizeof(*m_rowStat));<br>
> + memset(m_pir, 0, sizeof(*m_pir));<br>
> }<br>
><br>
> void FrameData::destroy()<br>
> @@ -66,4 +68,5 @@<br>
><br>
> X265_FREE(m_cuStat);<br>
> X265_FREE(m_rowStat);<br>
> + X265_FREE(m_pir);<br>
> }<br>
> diff -r 44cc2ce22c43 -r 2ba81f60f111 source/common/framedata.h<br>
> --- a/source/common/framedata.h Thu Sep 03 22:26:21 2015 +0530<br>
> +++ b/source/common/framedata.h Mon Sep 07 15:20:53 2015 +0530<br>
> @@ -134,7 +134,16 @@<br>
> RCStatCU* m_cuStat;<br>
> RCStatRow* m_rowStat;<br>
> FrameStats m_frameStats; // stats of current frame for multi-pass encodes<br>
> + /* data needed for periodic intra refresh */<br>
> + struct PeriodicIR<br>
> + {<br>
> + double position;<br>
> + uint32_t pirStartPelX;<br>
> + uint32_t pirEndPelX;<br>
> + int framesSinceLastPir;<br>
> + };<br>
<br>
</div></div>w/s<br>
<br>
> + PeriodicIR* m_pir;<br>
<br>
is there a compelling reason for this to be malloc'd?<br></blockquote><div>malloc is not necessary. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> double m_avgQpRc; /* avg QP as decided by rate-control */<br>
> double m_avgQpAq; /* avg QP as decided by AQ in addition to rate-control */<br>
> double m_rateFactor; /* calculated based on the Frame QP */<br>
> diff -r 44cc2ce22c43 -r 2ba81f60f111 source/encoder/encoder.cpp<br>
> --- a/source/encoder/encoder.cpp Thu Sep 03 22:26:21 2015 +0530<br>
> +++ b/source/encoder/encoder.cpp Mon Sep 07 15:20:53 2015 +0530<br>
> @@ -1517,6 +1517,7 @@<br>
> p->rc.cuTree = 0;<br>
> p->bEnableWeightedPred = 0;<br>
> p->bEnableWeightedBiPred = 0;<br>
> + p->bIntraRefresh = 0;<br>
><br>
> /* SPSs shall have sps_max_dec_pic_buffering_minus1[ sps_max_sub_layers_minus1 ] equal to 0 only */<br>
> p->maxNumReferences = 1;<br>
> @@ -1607,6 +1608,24 @@<br>
><br>
> if (p->totalFrames && p->totalFrames <= 2 * ((float)p->fpsNum) / p->fpsDenom && p->rc.bStrictCbr)<br>
> p->lookaheadDepth = p->totalFrames;<br>
> + if (p->bIntraRefresh && p->maxNumReferences > 1)<br>
> + {<br>
> + x265_log(p, X265_LOG_WARNING, "Max References > 1 + intra-refresh is not supported , setting max num references = 1\n");<br>
> + p->maxNumReferences = 1;<br>
> + }<br>
> + if (p->bIntraRefresh && p->maxNumReferences == 1)<br>
<br>
</span>checking maxNumReferences == 1 here is redundant<br>
<span class=""><br>
> + {<br>
> + if (p->bBPyramid == 1 && p->bframes > 0)<br>
<br>
</span>coding style nit, this could be: if (p->bBPyramid && p->bframes)<br>
<span class=""><br>
> + x265_log(p, X265_LOG_WARNING, "B pyramid cannot be enabled when max references is 1, Disabling B pyramid\n");<br>
> + p->bBPyramid = 0;<br>
> + }<br>
> +<br>
> + if (p->bIntraRefresh && p->bOpenGOP)<br>
> + {<br>
> + x265_log(p, X265_LOG_WARNING, "Open Gop disabled, Intra Refresh is not compatible with openGop\n");<br>
> + p->bOpenGOP = 0;<br>
> + }<br>
> +<br>
><br>
> if (p->scalingLists && p->internalCsp == X265_CSP_I444)<br>
> {<br>
> diff -r 44cc2ce22c43 -r 2ba81f60f111 source/x265.h<br>
> --- a/source/x265.h Thu Sep 03 22:26:21 2015 +0530<br>
> +++ b/source/x265.h Mon Sep 07 15:20:53 2015 +0530<br>
> @@ -702,6 +702,11 @@<br>
> * should detect scene cuts. The default (40) is recommended. */<br>
> int scenecutThreshold;<br>
><br>
> + /* Replace keyframes by using a column of intra blocks that move across the video<br>
> + * from one side to the other, thereby "refreshing" the image. In effect, instead of a<br>
> + * big keyframe, the keyframe is "spread" over many frames. */<br>
> + int bIntraRefresh;<br>
> +<br>
> /*== Coding Unit (CU) definitions ==*/<br>
><br>
> /* Maximum CU width and height in pixels. The size must be 64, 32, or 16.<br>
</span>> _______________________________________________<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></div></div>