[x265] [PATCH] ratecontrol: clean up struct; remove baseQp
deepthi at multicorewareinc.com
deepthi at multicorewareinc.com
Fri Feb 14 10:32:57 CET 2014
# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1392369946 -19800
# Node ID 7e63c189365d5347a8d414f88bd59725aa206077
# Parent ed310b17ff6681f191c85341cf6efe7a50770143
ratecontrol: clean up struct; remove baseQp
diff -r ed310b17ff66 -r 7e63c189365d source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Fri Feb 14 02:30:52 2014 -0600
+++ b/source/encoder/ratecontrol.cpp Fri Feb 14 14:55:46 2014 +0530
@@ -231,8 +231,7 @@
bitrate = cfg->param.rc.bitrate * 1000;
frameDuration = 1.0 / cfg->param.frameRate;
lastNonBPictType = -1;
- baseQp = cfg->param.rc.qp;
- qp = baseQp;
+ qp = cfg->param.rc.qp;
lastRceq = 1; /* handles the cmplxrsum when the previous frame cost is zero */
totalBits = 0;
shortTermCplxSum = 0;
@@ -353,9 +352,9 @@
if (cfg->param.rc.rateControlMode == X265_RC_CQP)
{
- qpConstant[P_SLICE] = baseQp;
- qpConstant[I_SLICE] = Clip3(0, MAX_MAX_QP, (int)(baseQp - ipOffset + 0.5));
- qpConstant[B_SLICE] = Clip3(0, MAX_MAX_QP, (int)(baseQp + pbOffset + 0.5));
+ qpConstant[P_SLICE] = qp;
+ qpConstant[I_SLICE] = Clip3(0, MAX_MAX_QP, (int)(qp - ipOffset + 0.5));
+ qpConstant[B_SLICE] = Clip3(0, MAX_MAX_QP, (int)(qp + pbOffset + 0.5));
}
/* qstep - value set as encoder specific */
diff -r ed310b17ff66 -r 7e63c189365d source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h Fri Feb 14 02:30:52 2014 -0600
+++ b/source/encoder/ratecontrol.h Fri Feb 14 14:55:46 2014 +0530
@@ -79,7 +79,7 @@
int ncu; /* number of CUs in a frame */
int keyFrameInterval; /* TODO: need to initialize in init */
int qp; /* updated qp for current frame */
- int baseQp; /* CQP base QP */
+
double frameDuration; /* current frame duration in seconds */
double bitrate;
double rateFactorConstant;
More information about the x265-devel
mailing list