[x265] x265-devel Digest, Vol 81, Issue 39

Snehaa Giridharan snehaa at multicorewareinc.com
Wed Mar 18 14:28:49 CET 2020


Resending these set of patches after addressing all the comments in a
while, Please omit these.

Thanks,
Snehaa.G

On Tue, Feb 25, 2020 at 11:30 PM <x265-devel-request at videolan.org> wrote:

> Send x265-devel mailing list submissions to
>         x265-devel at videolan.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.videolan.org/listinfo/x265-devel
> or, via email, send a message with subject or body 'help' to
>         x265-devel-request at videolan.org
>
> You can reach the person managing the list at
>         x265-devel-owner at videolan.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of x265-devel digest..."
>
>
> Today's Topics:
>
>    1. Re: [PATCH] zone: Fix BufferRate mismatch and log unclipped
>       BufferFillFinal into csv (Aruna Matheswaran)
>    2. Re: [PATCH] Add option to get global maxrate (Aruna Matheswaran)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 25 Feb 2020 22:39:59 +0530
> From: Aruna Matheswaran <aruna at multicorewareinc.com>
> To: Development for x265 <x265-devel at videolan.org>
> Subject: Re: [x265] [PATCH] zone: Fix BufferRate mismatch and log
>         unclipped BufferFillFinal into csv
> Message-ID:
>         <
> CAOdJ0O4z594TUpoo+kM3OOYjnrz+Jf5BVWGGXqv-2cgjE+LrRw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Wed, Feb 19, 2020 at 3:28 PM Snehaa Giridharan <
> snehaa at multicorewareinc.com> wrote:
>
> > # HG changeset patch
> > # User Snehaa Giridharan <snehaa at multicorewareinc.com>
> > # Date 1575548701 -19800
> > #      Thu Dec 05 17:55:01 2019 +0530
> > # Node ID 495e78dfd32bcdeee0c48a8732eba135be12cb8e
> > # Parent  ce3a4929efca3034bce12b7449d73ed2e03f9b4d
> > zone: Fix BufferRate mismatch and log unclipped BufferFillFinal into csv
> >
> > This commit fixes
> > - Mismatch in BufferRate
> >
> Please brief this.
>
> > - Log UnclippedBufferFillFinal into csv when csvloglevel greater than 1
> >
> > diff --git a/doc/reST/cli.rst b/doc/reST/cli.rst
> > --- a/doc/reST/cli.rst
> > +++ b/doc/reST/cli.rst
> > @@ -107,6 +107,9 @@
> >
> >   **BufferFillFinal** Buffer bits available after removing the frame out
> > of CPB.
> >
> > + **UnclippedBufferFillFinal** Unclipped buffer bits available after
> > removing the frame
> > + out of CPB only used for csv logging purpose.
> > +
> >   **Latency** Latency in terms of number of frames between when the frame
> >   was given in and when the frame is given out.
> >
> > diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp
> > --- a/source/encoder/api.cpp
> > +++ b/source/encoder/api.cpp
> > @@ -1294,6 +1294,8 @@
> >                      fprintf(csvfp, "RateFactor, ");
> >                  if (param->rc.vbvBufferSize)
> >                      fprintf(csvfp, "BufferFill, BufferFillFinal, ");
> > +                if (param->csvLogLevel >= 2)
> >
> Need to check if  param->rc.vbvBufferSize  is set.
>
> > +                    fprintf(csvfp, "UnclippedBufferFillFinal, ");
> >                  if (param->bEnablePsnr)
> >                      fprintf(csvfp, "Y PSNR, U PSNR, V PSNR, YUV PSNR,
> ");
> >                  if (param->bEnableSsim)
> > @@ -1405,6 +1407,8 @@
> >          fprintf(param->csvfpt, "%.3lf,", frameStats->rateFactor);
> >      if (param->rc.vbvBufferSize)
> >          fprintf(param->csvfpt, "%.3lf, %.3lf,", frameStats->bufferFill,
> > frameStats->bufferFillFinal);
> > +    if (param->csvLogLevel >= 2)
> >
> Same here.
>
> > +        fprintf(param->csvfpt, "%.3lf,",
> > frameStats->unclippedBufferFillFinal);
> >      if (param->bEnablePsnr)
> >          fprintf(param->csvfpt, "%.3lf, %.3lf, %.3lf, %.3lf,",
> > frameStats->psnrY, frameStats->psnrU, frameStats->psnrV,
> frameStats->psnr);
> >      if (param->bEnableSsim)
> > diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
> > --- a/source/encoder/encoder.cpp
> > +++ b/source/encoder/encoder.cpp
> > @@ -3012,6 +3012,8 @@
> >              frameStats->ipCostRatio = curFrame->m_lowres.ipCostRatio;
> >          frameStats->bufferFill = m_rateControl->m_bufferFillActual;
> >          frameStats->bufferFillFinal = m_rateControl->m_bufferFillFinal;
> > +        if (m_param->csvLogLevel >= 2)
> > +            frameStats->unclippedBufferFillFinal =
> > m_rateControl->m_unclippedBufferFillFinal;
> >          frameStats->frameLatency = inPoc - poc;
> >          if (m_param->rc.rateControlMode == X265_RC_CRF)
> >              frameStats->rateFactor = curEncData.m_rateFactor;
> > diff --git a/source/encoder/ratecontrol.cpp
> > b/source/encoder/ratecontrol.cpp
> > --- a/source/encoder/ratecontrol.cpp
> > +++ b/source/encoder/ratecontrol.cpp
> > @@ -2745,7 +2745,9 @@
> >          x265_log(m_param, X265_LOG_WARNING, "poc:%d, VBV underflow (%.0f
> > bits)\n", rce->poc, m_bufferFillFinal);
> >
> >      m_bufferFillFinal = X265_MAX(m_bufferFillFinal, 0);
> > -    m_bufferFillFinal += m_bufferRate;
> > +    m_bufferFillFinal += rce->bufferRate;
> > +    if (m_param->csvLogLevel >= 2)
> > +        m_unclippedBufferFillFinal = m_bufferFillFinal;
> >
> >      if (m_param->rc.bStrictCbr)
> >      {
> > @@ -2755,14 +2757,14 @@
> >              filler += FILLER_OVERHEAD * 8;
> >          }
> >          m_bufferFillFinal -= filler;
> > -        bufferBits = X265_MIN(bits + filler + m_bufferExcess,
> > m_bufferRate);
> > +        bufferBits = X265_MIN(bits + filler + m_bufferExcess,
> > rce->bufferRate);
> >          m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits +
> > filler, 0);
> >          m_bufferFillActual += bufferBits - bits - filler;
> >      }
> >      else
> >      {
> >          m_bufferFillFinal = X265_MIN(m_bufferFillFinal, m_bufferSize);
> > -        bufferBits = X265_MIN(bits + m_bufferExcess, m_bufferRate);
> > +        bufferBits = X265_MIN(bits + m_bufferExcess, rce->bufferRate);
> >          m_bufferExcess = X265_MAX(m_bufferExcess - bufferBits + bits,
> 0);
> >          m_bufferFillActual += bufferBits - bits;
> >          m_bufferFillActual = X265_MIN(m_bufferFillActual, m_bufferSize);
> > diff --git a/source/encoder/ratecontrol.h b/source/encoder/ratecontrol.h
> > --- a/source/encoder/ratecontrol.h
> > +++ b/source/encoder/ratecontrol.h
> > @@ -157,6 +157,7 @@
> >      double m_rateFactorConstant;
> >      double m_bufferSize;
> >      double m_bufferFillFinal;  /* real buffer as of the last finished
> > frame */
> > +    double m_unclippedBufferFillFinal; /* real unclipped buffer as of
> the
> > last finished frame used to log in CSV*/
> >      double m_bufferFill;       /* planned buffer, if all in-progress
> > frames hit their bit budget */
> >      double m_bufferRate;       /* # of bits added to buffer_fill after
> > each frame */
> >      double m_vbvMaxRate;       /* in kbps */
> > diff --git a/source/x265.h b/source/x265.h
> > --- a/source/x265.h
> > +++ b/source/x265.h
> > @@ -304,6 +304,7 @@
> >      double           totalFrameTime;
> >      double           vmafFrameScore;
> >      double           bufferFillFinal;
> > +    double           unclippedBufferFillFinal;
> >
> Increment X265_BUILD.
>
> >  } x265_frame_stats;
> >
> >  typedef struct x265_ctu_info_t
> >
> > --
> > *Thanks and Regards,*
> > *Snehaa.G*
> > _______________________________________________
> > x265-devel mailing list
> > x265-devel at videolan.org
> > https://mailman.videolan.org/listinfo/x265-devel
> >
>
>
> --
> Regards,
> *Aruna Matheswaran,*
> Video Codec Engineer,
> Media & AI analytics BU,
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.videolan.org/pipermail/x265-devel/attachments/20200225/322c9a40/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Tue, 25 Feb 2020 23:30:15 +0530
> From: Aruna Matheswaran <aruna at multicorewareinc.com>
> To: Development for x265 <x265-devel at videolan.org>
> Subject: Re: [x265] [PATCH] Add option to get global maxrate
> Message-ID:
>         <
> CAOdJ0O4cF3CemHx+7jScShRg9vy8674pucKYL3J1W5LoQ2R0fA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Wed, Feb 19, 2020 at 3:28 PM Snehaa Giridharan <
> snehaa at multicorewareinc.com> wrote:
>
> > # HG changeset patch
> > # User Snehaa Giridharan <snehaa at multicorewareinc.com>
> > # Date 1582105413 -19800
> > #      Wed Feb 19 15:13:33 2020 +0530
> > # Node ID 968e8839eade282f6cd687d43c18bb4ee512ee01
> > # Parent  495e78dfd32bcdeee0c48a8732eba135be12cb8e
> > Add option to get global maxrate
> >
> > This global maxrate can be used for HRD signaling
> >
> > diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
> > --- a/source/CMakeLists.txt
> > +++ b/source/CMakeLists.txt
> > @@ -29,7 +29,7 @@
> >  option(STATIC_LINK_CRT "Statically link C runtime for release builds"
> OFF)
> >  mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
> >  # X265_BUILD must be incremented each time the public API is changed
> > -set(X265_BUILD 189)
> > +set(X265_BUILD 190)
> >  configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
> >                 "${PROJECT_BINARY_DIR}/x265.def")
> >  configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
> > diff --git a/source/common/param.cpp b/source/common/param.cpp
> > --- a/source/common/param.cpp
> > +++ b/source/common/param.cpp
> > @@ -286,6 +286,7 @@
> >      param->rc.bEnableConstVbv = 0;
> >      param->bResetZoneConfig = 1;
> >      param->reconfigWindowSize = 0;
> > +    param->decoderVbvMaxRate = 0;
> >
> >      /* Video Usability Information (VUI) */
> >      param->vui.aspectRatioIdc = 0;
> > @@ -2435,6 +2436,7 @@
> >      dst->rc.zonefileCount = src->rc.zonefileCount;
> >      dst->reconfigWindowSize = src->reconfigWindowSize;
> >      dst->bResetZoneConfig = src->bResetZoneConfig;
> > +    dst->decoderVbvMaxRate = src->decoderVbvMaxRate;
> >
> Missing corresponding entries in info SEI and x265_check_param.
>
> >
> >      if (src->rc.zonefileCount && src->rc.zones)
> >      {
> > diff --git a/source/encoder/ratecontrol.cpp
> > b/source/encoder/ratecontrol.cpp
> > --- a/source/encoder/ratecontrol.cpp
> > +++ b/source/encoder/ratecontrol.cpp
> > @@ -335,7 +335,7 @@
> >          int vbvBufferSize = m_param->rc.vbvBufferSize * 1000;
> >          int vbvMaxBitrate = m_param->rc.vbvMaxBitrate * 1000;
> >
> > -        if (m_param->bEmitHRDSEI)
> > +        if (m_param->bEmitHRDSEI && !m_param->decoderVbvMaxRate)
> >          {
> >              const HRDInfo* hrd = &sps.vuiParameters.hrdParameters;
> >              vbvBufferSize = hrd->cpbSizeValue << (hrd->cpbSizeScale +
> > CPB_SHIFT);
> > @@ -781,8 +781,10 @@
> >      // Init HRD
> >      HRDInfo* hrd = &sps.vuiParameters.hrdParameters;
> >      hrd->cbrFlag = m_isCbr;
> > -    if (m_param->reconfigWindowSize)
> > +    if (m_param->reconfigWindowSize) {
> >          hrd->cbrFlag = 0;
> > +        vbvMaxBitrate = m_param->decoderVbvMaxRate * 1000;
> > +    }
> >
> >      // normalize HRD size and rate to the value / scale notation
> >      hrd->bitRateScale = x265_clip3(0, 15, calcScale(vbvMaxBitrate) -
> > BR_SHIFT);
> > diff --git a/source/x265.h b/source/x265.h
> > --- a/source/x265.h
> > +++ b/source/x265.h
> > @@ -1905,6 +1905,9 @@
> >
> >      /* Edge variance threshold for quad tree establishment. */
> >      float    edgeVarThreshold;
> > +
> > + /*Maxrate that could be signaled to the decoder. Default 0. API only.
> */
> > + int         decoderVbvMaxRate;
> >
> Indentation issue.
> Add an entry for the same in cli.rst
>
> >  } x265_param;
> >
> >  /* x265_param_alloc:
> >
> > --
> > *Thanks and Regards,*
> > *Snehaa.G*
> > _______________________________________________
> > x265-devel mailing list
> > x265-devel at videolan.org
> > https://mailman.videolan.org/listinfo/x265-devel
> >
>
>
> --
> Regards,
> *Aruna Matheswaran,*
> Video Codec Engineer,
> Media & AI analytics BU,
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.videolan.org/pipermail/x265-devel/attachments/20200225/3c76d7f2/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
> ------------------------------
>
> End of x265-devel Digest, Vol 81, Issue 39
> ******************************************
>


-- 
*Thanks and Regards,*
*Snehaa.G*

<https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=5d1cffcc-cd7a-478a-8410-76188ea236f6>
I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.
<https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=5d1cffcc-cd7a-478a-8410-76188ea236f6>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

<https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=5d1cffcc-cd7a-478a-8410-76188ea236f6>
I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.
<https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=5d1cffcc-cd7a-478a-8410-76188ea236f6>
<#m_-8154922652414539344_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20200318/d89f635e/attachment-0001.html>


More information about the x265-devel mailing list