[x265-commits] [x265] ratecontrol: use param.rc.rateControlMode, from duplicate...
Steve Borho
steve at borho.org
Sat Oct 12 06:41:58 CEST 2013
details: http://hg.videolan.org/x265/rev/9a02765f182e
branches:
changeset: 4425:9a02765f182e
user: Steve Borho <steve at borho.org>
date: Fri Oct 11 23:41:41 2013 -0500
description:
ratecontrol: use param.rc.rateControlMode, from duplicate RC var
diffstat:
source/encoder/ratecontrol.cpp | 10 +++++-----
source/encoder/ratecontrol.h | 1 -
2 files changed, 5 insertions(+), 6 deletions(-)
diffs (59 lines):
diff -r f77efd501767 -r 9a02765f182e source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Fri Oct 11 23:13:03 2013 -0500
+++ b/source/encoder/ratecontrol.cpp Fri Oct 11 23:41:41 2013 -0500
@@ -64,7 +64,7 @@ RateControl::RateControl(TEncCfg * _cfg)
shortTermCplxSum = 0;
shortTermCplxCount = 0;
framesDone = 0;
- if (rateControlMode == X265_RC_ABR)
+ if (cfg->param.rc.rateControlMode == X265_RC_ABR)
{
// Adjust the first frame in order to stabilize the quality level compared to the rest.
#define ABR_INIT_QP_MIN (24 + QP_BD_OFFSET)
@@ -85,7 +85,7 @@ RateControl::RateControl(TEncCfg * _cfg)
lmax[i] = qp2qScale(MAX_QP);
}
- if (rateControlMode == X265_RC_CQP)
+ if (cfg->param.rc.rateControlMode == X265_RC_CQP)
{
qpConstant[P_SLICE] = baseQp;
qpConstant[I_SLICE] = Clip3(0, MAX_QP, (int)(baseQp - ipOffset + 0.5));
@@ -101,7 +101,7 @@ void RateControl::rateControlStart(TComP
curFrame = pic->getSlice();
frameType = curFrame->getSliceType();
- switch (rateControlMode)
+ switch (cfg->param.rc.rateControlMode)
{
case X265_RC_ABR:
{
@@ -230,7 +230,7 @@ double RateControl::rateEstimateQscale(R
q = qp2qScale(accumPQp / accumPNorm);
q /= fabs(ipFactor);
}
- if (rateControlMode != X265_RC_CRF)
+ if (cfg->param.rc.rateControlMode != X265_RC_CRF)
{
double lqmin = 0, lqmax = 0;
@@ -304,7 +304,7 @@ double RateControl::getQScale(RateContro
/* After encoding one frame, update ratecontrol state */
int RateControl::rateControlEnd(int64_t bits, RateControlEntry* rce)
{
- if (rateControlMode == X265_RC_ABR)
+ if (cfg->param.rc.rateControlMode == X265_RC_ABR)
{
if (frameType != B_SLICE)
/* The factor 1.5 is to tune up the actual bits, otherwise the cplxrSum is scaled too low
diff -r f77efd501767 -r 9a02765f182e source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h Fri Oct 11 23:13:03 2013 -0500
+++ b/source/encoder/ratecontrol.h Fri Oct 11 23:41:41 2013 -0500
@@ -73,7 +73,6 @@ struct RateControl
double lmax[3];
double shortTermCplxSum;
double shortTermCplxCount;
- RcMethod rateControlMode;
int64_t totalBits; /* totalbits used for already encoded frames */
double lastRceq;
int framesDone; /* framesDone keeps track of # of frames passed through RateCotrol already */
More information about the x265-commits
mailing list