[x265] [PATCH] Set frame as keyint if scalinglist reconfigure

Aarthi Priya Thirumalai aarthi at multicorewareinc.com
Wed Dec 21 06:21:18 CET 2016


On Wed, Dec 21, 2016 at 10:15 AM, <vignesh at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Vignesh Vijayakumar <vignesh at multicorewareinc.com>
> # Date 1482232112 -19800
> #      Tue Dec 20 16:38:32 2016 +0530
> # Node ID 97d011cd7fe2b7dc1ecd2cebb887e1536b810052
> # Parent  88285bf550a4f88bb09ff5b49ec46b81140a025d
> Set frame as keyint if scalinglist reconfigure
>
> diff -r 88285bf550a4 -r 97d011cd7fe2 source/encoder/encoder.cpp
> --- a/source/encoder/encoder.cpp        Tue Dec 20 16:35:53 2016 +0530
> +++ b/source/encoder/encoder.cpp        Tue Dec 20 16:38:32 2016 +0530
> @@ -78,6 +78,7 @@
>      m_iPPSQpMinus26 = 0;
>      m_iLastSliceQp = 0;
>      m_rpsInSpsCount = 0;
> +    m_reconfigureScalingLists = false;
>      for (int i = 0; i < X265_MAX_FRAME_THREADS; i++)
>          m_frameEncoder[i] = NULL;
>
> @@ -842,6 +843,12 @@
>              frameEnc = m_lookahead->getDecidedPicture();
>          if (frameEnc && !pass)
>          {
>
You can't make it a keyframe this way. A keyframe can't be of any
slicetype. It needs to be IDR. You need to change the slicetype as well.
You need to set the m_reconfigureScalingLists to true  while you are
reconfiguring the scaling List inside the x265_encoder_reconfig()
and based on this, you need to set the next incoming frame's slice type to
I/IDR and set it as keyframe during the slicetype analysis of that frame.
It will in turn change the slice types of the following frames accordingly.

Else, reconfigure scaling list only at every keyframe interval - this is
what I would recommend.

+            if (m_param->bRepeatHeaders && m_reconfigure && m_latestParam
> != NULL && (m_latestParam->scalingLists != m_param->scalingLists) &&
> !m_reconfigureScalingLists)
> +            {
> +                frameEnc->m_lowres.bKeyframe = true;
> +                m_reconfigureScalingLists = true;
> +            }
> +
>              if (curEncoder->m_reconfigure)
>              {
>                  /* One round robin cycle of FE reconfigure is complete */
> diff -r 88285bf550a4 -r 97d011cd7fe2 source/encoder/encoder.h
> --- a/source/encoder/encoder.h  Tue Dec 20 16:35:53 2016 +0530
> +++ b/source/encoder/encoder.h  Tue Dec 20 16:38:32 2016 +0530
> @@ -150,6 +150,7 @@
>      bool               m_bZeroLatency;     // x265_encoder_encode()
> returns NALs for the input picture, zero lag
>      bool               m_aborted;          // fatal error detected
>      bool               m_reconfigure;      // Encoder reconfigure in
> progress
> +    bool               m_reconfigureScalingLists;    // Change in
> scalinglists
>
>      /* Begin intra refresh when one not in progress or else begin one as
> soon as the current
>       * one is done. Requires bIntraRefresh to be set.*/
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161221/1630f180/attachment-0001.html>


More information about the x265-devel mailing list