[x265] [PATCH] tighten rate control logic for ABR
aarthi at multicorewareinc.com
aarthi at multicorewareinc.com
Thu Sep 5 20:46:13 CEST 2013
# HG changeset patch
# User Aarthi Thirumalai<aarthi at multicorewareinc.com>
# Date 1378406761 -19800
# Fri Sep 06 00:16:01 2013 +0530
# Node ID a0feab910835feb34ad5b893e46247be08dbdb4b
# Parent bce4dbc57e094c489504d3e23a3b66c625d214cc
tighten rate control logic for ABR
diff -r bce4dbc57e09 -r a0feab910835 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Thu Sep 05 14:57:16 2013 +0530
+++ b/source/encoder/ratecontrol.cpp Fri Sep 06 00:16:01 2013 +0530
@@ -187,12 +187,16 @@
q += pbOffset / 2;
else
q += pbOffset;
+
+ double qScale = qp2qScale(q);
- return qp2qScale(q);
+ lastQScaleFor[P_SLICE] = lastQScale = qScale/pbFactor;
+
+ return qScale;
}
else
{
- double abrBuffer = 2 * rateTolerance * bitrate;
+ double abrBuffer = 0.9 * rateTolerance * bitrate;
/* 1pass ABR */
@@ -300,12 +304,12 @@
if (rateControlMode == X265_RC_ABR)
{
if (frameType != B_SLICE)
- cplxrSum += bits * qp2qScale(qpaRc) / lastRceq;
+ cplxrSum += 1.1 *bits * qp2qScale(qpaRc) / lastRceq;
else
{
/* Depends on the fact that B-frame's QP is an offset from the following P-frame's.
* Not perfectly accurate with B-refs, but good enough. */
- cplxrSum += bits * qp2qScale(qpaRc) / (lastRceq * fabs(pbFactor));
+ cplxrSum += bits * qp2qScale(qpaRc) / (lastRceq * fabs(0.5 * pbFactor));
}
cplxrSum *= cbrDecay;
wantedBitsWindow += frameDuration * bitrate;
More information about the x265-devel
mailing list