[x265] [PATCH 3 of 4] rc: update logic in clipQScale for vbv, when vbv lookahead is done,

Steve Borho steve at borho.org
Thu May 8 20:56:56 CEST 2014


On Thu, May 8, 2014 at 1:28 PM,  <aarthi at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1399573469 -19800
> #      Thu May 08 23:54:29 2014 +0530
> # Node ID 164e47dc38c4b89492fb98177248fb8254a9d54a
> # Parent  7ae5c6b44e111240f8b0727254db0c2ca91c0506
> rc: update logic in clipQScale for vbv, when vbv lookahead is done,
>
> diff -r 7ae5c6b44e11 -r 164e47dc38c4 source/encoder/ratecontrol.cpp
> --- a/source/encoder/ratecontrol.cpp    Thu May 08 23:51:49 2014 +0530
> +++ b/source/encoder/ratecontrol.cpp    Thu May 08 23:54:29 2014 +0530
> @@ -662,8 +662,15 @@
>      // B-frames are not directly subject to VBV,
>      // since they are controlled by the P-frames' QPs.
>      double q0 = q;
> -    if (param->lookaheadDepth)
> +
> +    if (param->lookaheadDepth || param->rc.cuTree ||
> +       param->scenecutThreshold ||
> +       (param->bFrameAdaptive && param->bframes))

it's unfortunate this logic has to be repeated in so many places

>      {
> +       /* Lookahead VBV: If lookahead is done, raise the quantizer as necessary such that no frames in
> +       the lookahead overflow and such that the buffer is in a reasonable state
> +       by the end of the lookahead. */

queued with some comment cleanups

> +
>          int terminate = 0;
>
>          /* Avoid an infinite loop. */
> @@ -712,6 +719,7 @@
>      }
>      else
>      {
> +        /* Fallback to old purely-reactive algorithm: no lookahead. */
>          if ((sliceType == P_SLICE ||
>                  (sliceType == I_SLICE && lastNonBPictType == I_SLICE)) &&
>              bufferFill / bufferSize < 0.5)
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



-- 
Steve Borho


More information about the x265-devel mailing list