[x265-commits] [x265] slicetype: initialize bReady (bug spotted by valgrind)

Steve Borho steve at borho.org
Mon May 19 07:57:14 CEST 2014


details:   http://hg.videolan.org/x265/rev/8b6c5d7ff4c0
branches:  
changeset: 6872:8b6c5d7ff4c0
user:      Steve Borho <steve at borho.org>
date:      Fri May 16 16:25:10 2014 +0530
description:
slicetype: initialize bReady (bug spotted by valgrind)
Subject: [x265] ratecontrol: initialize singleFrameVbv (bug spotted by valgrind)

details:   http://hg.videolan.org/x265/rev/2d5dc4e63fb9
branches:  
changeset: 6873:2d5dc4e63fb9
user:      Steve Borho <steve at borho.org>
date:      Fri May 16 16:34:30 2014 +0530
description:
ratecontrol: initialize singleFrameVbv (bug spotted by valgrind)
Subject: [x265] rest: improve --rd docs

details:   http://hg.videolan.org/x265/rev/4739c02a62c0
branches:  
changeset: 6874:4739c02a62c0
user:      Steve Borho <steve at borho.org>
date:      Fri May 16 16:57:15 2014 +0530
description:
rest: improve --rd docs
Subject: [x265] psyrd: use actual recon pixels for intra predictions (bug spotted by valgrind)

details:   http://hg.videolan.org/x265/rev/f3f3eecd28f1
branches:  
changeset: 6875:f3f3eecd28f1
user:      Steve Borho <steve at borho.org>
date:      Fri May 16 17:05:07 2014 +0530
description:
psyrd: use actual recon pixels for intra predictions (bug spotted by valgrind)
Subject: [x265] psyrd: use EMMS before checking calcPsyRdCost

details:   http://hg.videolan.org/x265/rev/c78bed701db4
branches:  
changeset: 6876:c78bed701db4
user:      Steve Borho <steve at borho.org>
date:      Mon May 19 00:56:18 2014 -0500
description:
psyrd: use EMMS before checking calcPsyRdCost

diffstat:

 doc/reST/cli.rst                   |  25 +++++++++++++++++++++++--
 source/Lib/TLibCommon/TComRdCost.h |   3 +++
 source/Lib/TLibEncoder/TEncCu.cpp  |   6 ++----
 source/encoder/ratecontrol.cpp     |   1 +
 source/encoder/slicetype.cpp       |   1 +
 5 files changed, 30 insertions(+), 6 deletions(-)

diffs (105 lines):

diff -r 7d11f60c5dba -r c78bed701db4 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Fri May 16 14:31:01 2014 +0530
+++ b/doc/reST/cli.rst	Mon May 19 00:56:18 2014 -0500
@@ -416,8 +416,8 @@ Spatial/intra options
 
 .. option:: --b-intra, --no-b-intra
 
-	Enables the use of intra modes in very slow presets (rdLevel 5 or
-	6). Presets slow to ultrafast do not try intra in B frames
+	Enables the use of intra modes in very slow presets (:option:`--rd`
+	5 or 6). Presets slow to ultrafast do not try intra in B frames
 	regardless of this setting. Default enabled.
 
 .. option:: --tskip, --no-tskip
@@ -623,6 +623,27 @@ Quality, rate control and rate distortio
 	used. The lower the value the faster the encode, the higher the
 	value the smaller the bitstream (in general). Default 3
 
+	Note that this table aims for accuracy, but is not necessarily our
+	final target behavior for each mode.
+
+	+-------+-------------------------------------------------------+
+	| Level | Description                                           |
+	+=======+=======================================================+
+	| 0     | sa8d mode and split decisions, intra w/ source pixels |
+	+-------+-------------------------------------------------------+
+	| 1     | recon generated (better intra), RDO merge residual    |
+	+-------+-------------------------------------------------------+
+	| 2     | RDO splits and merge residual choice                  |
+	+-------+-------------------------------------------------------+
+	| 3     | RDO mode decision and splits                          |
+	+-------+-------------------------------------------------------+
+	| 4     | Adds RDO Quant                                        |
+	+-------+-------------------------------------------------------+
+	| 5     | Enables intra modes in B slices                       |
+	+-------+-------------------------------------------------------+
+	| 6     | Currently same as 5                                   |
+	+-------+-------------------------------------------------------+
+
 	**Range of values:** 0: least .. 6: full RDO analysis
 
 .. option:: --psy-rd <float>
diff -r 7d11f60c5dba -r c78bed701db4 source/Lib/TLibCommon/TComRdCost.h
--- a/source/Lib/TLibCommon/TComRdCost.h	Fri May 16 14:31:01 2014 +0530
+++ b/source/Lib/TLibCommon/TComRdCost.h	Mon May 19 00:56:18 2014 -0500
@@ -120,9 +120,12 @@ public:
     inline uint64_t calcPsyRdCost(uint32_t distortion, uint32_t bits, uint32_t psycost)
     {
         uint64_t tot = bits + (((psycost * m_psyRdScale) + 128) >> 8);
+#if CHECKED_BUILD || _DEBUG
+        x265_emms();
         X265_CHECK(abs((float)((tot * m_lambdaMotionSSE + 128) >> 8) -
                        (float)tot * m_lambdaMotionSSE / 256.0) < 2,
                    "calcPsyRdCost wrap detected tot: "X265_LL", lambda: "X265_LL"\n", tot, m_lambdaMotionSSE);
+#endif
         return distortion + ((tot * m_lambdaMotionSSE + 128) >> 8);
     }
 
diff -r 7d11f60c5dba -r c78bed701db4 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Fri May 16 14:31:01 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Mon May 19 00:56:18 2014 -0500
@@ -1392,9 +1392,8 @@ void TEncCu::xCheckRDCostIntra(TComDataC
     if (m_rdCost->psyRdEnabled())
     {
         int part = g_convertToBit[outTempCU->getCUSize(0)];
-        TComPicYuv *recon = outTempCU->getPic()->getPicYuvRec();
         uint32_t psyRdCost = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
-                                                     recon->getLumaAddr(outTempCU->getAddr()), recon->getStride());
+                                                     m_tmpRecoYuv[depth]->getLumaAddr(), m_tmpRecoYuv[depth]->getStride());
         outTempCU->m_totalCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, psyRdCost);
     }
     else
@@ -1440,9 +1439,8 @@ void TEncCu::xCheckRDCostIntraInInter(TC
     if (m_rdCost->psyRdEnabled())
     {
         int part = g_convertToBit[outTempCU->getCUSize(0)];
-        TComPicYuv *recon = outTempCU->getPic()->getPicYuvRec();
         uint32_t psyRdCost = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
-                                                     recon->getLumaAddr(outTempCU->getAddr()), recon->getStride());
+                                                     m_tmpRecoYuv[depth]->getLumaAddr(), m_tmpRecoYuv[depth]->getStride());
         outTempCU->m_totalCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, psyRdCost);
     }
     else
diff -r 7d11f60c5dba -r c78bed701db4 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Fri May 16 14:31:01 2014 +0530
+++ b/source/encoder/ratecontrol.cpp	Mon May 19 00:56:18 2014 -0500
@@ -246,6 +246,7 @@ RateControl::RateControl(Encoder * _cfg)
     param->rc.vbvMaxBitrate = Clip3(0, 2000000, param->rc.vbvMaxBitrate);
     param->rc.vbvBufferInit = Clip3(0.0, 2000000.0, param->rc.vbvBufferInit);
     vbvMinRate = 0;
+    singleFrameVbv = 0;
     if (param->rc.vbvBufferSize)
     {
         if (param->rc.rateControlMode == X265_RC_CQP)
diff -r 7d11f60c5dba -r c78bed701db4 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Fri May 16 14:31:01 2014 +0530
+++ b/source/encoder/slicetype.cpp	Mon May 19 00:56:18 2014 -0500
@@ -58,6 +58,7 @@ Lookahead::Lookahead(Encoder *_cfg, Thre
     : JobProvider(pool)
     , est(pool)
 {
+    bReady = 0;
     param = _cfg->param;
     lastKeyframe = -param->keyframeMax;
     lastNonB = NULL;


More information about the x265-commits mailing list