[x265] [PATCH] RateControl : Bug fix when previous estimated frame cost is zero
Steve Borho
steve at borho.org
Tue Sep 24 09:07:44 CEST 2013
On Tue, Sep 24, 2013 at 1:33 AM, <sumalatha at multicorewareinc.com> wrote:
> # HG changeset patch
> # User sumalatha polureddy
> # Date 1380004245 -19800
> # Node ID 759460e7afeeb7d97ea427a702ac08eb9d8a3293
> # Parent 6fa50183e0098f9e94b677ef8dc00c416f28c0f3
> RateControl : Bug fix when previous estimated frame cost is zero
>
queued for stable after some white-space cleanups
> diff -r 6fa50183e009 -r 759460e7afee source/encoder/ratecontrol.cpp
> --- a/source/encoder/ratecontrol.cpp Tue Sep 24 11:56:43 2013 +0530
> +++ b/source/encoder/ratecontrol.cpp Tue Sep 24 12:00:45 2013 +0530
> @@ -62,7 +62,7 @@
> lastNonBPictType = -1;
> baseQp = param->rc.qp;
> qp = baseQp;
> -
> + lastRceq = 1; // handles the cmplxrsum when the previous frame cost
> is zero
> // heuristics- encoder specific
> qCompress = param->rc.qCompress; // tweak and test for x265.
> ipFactor = param->rc.ipFactor;
> @@ -255,15 +255,20 @@
> lqmax = lastQScaleFor[pictType] * lstep;
> }
> /* Rate control needs to be more aggressive based on actual
> costs obtained for previous encoded frame */
> - if (overflow > 1.1 && framesDone > 3)
> - {
> - lqmax *= lstep;
> - lqmin*= pow(lstep,1/frameThreads);
> - }
> - else if (overflow < 0.9)
> - {
> - lqmin /= lstep;
> - lqmax /= pow(lstep,1/frameThreads);
> + int rfAdapt = 1;
> + if (overflow > 1.1 && framesDone > 3)
> + {
> + //Control propagation of excessive overflow / underfow
> + if(overflow > 1.5)
> + rfAdapt = 2;
> + lqmax *= pow(lstep, rfAdapt);
> + }
> + else if (overflow < 0.9)
> + {
> + if(overflow < 0.6)
> + rfAdapt = 2;
> + lqmin /= pow(lstep, rfAdapt);
> + lqmax /= pow(lstep, rfAdapt / frameThreads);
> }
> q = Clip3(lqmin, lqmax, q);
> }
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130924/4bc12c1c/attachment.html>
More information about the x265-devel
mailing list