[x265] fix uninitialized

Satoshi Nakagawa nakagawa424 at oki.com
Wed Oct 29 10:22:27 CET 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1414570941 -32400
#      Wed Oct 29 17:22:21 2014 +0900
# Node ID 1f0b295a6dfac9457deea4efe81261edf21f5039
# Parent  da5ba239bf59a48d9b586c54bf2d0a5320043044
fix uninitialized

diff -r da5ba239bf59 -r 1f0b295a6dfa source/common/predict.cpp
--- a/source/common/predict.cpp	Wed Oct 29 09:13:25 2014 +0530
+++ b/source/common/predict.cpp	Wed Oct 29 17:22:21 2014 +0900
@@ -144,12 +144,17 @@
     primitives.intra_pred[dirMode][sizeIdx](dst, stride, left, above, dirMode, 0);
 }
 
-void Predict::prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
+void Predict::initMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
 {
     m_predSlice = cu.m_slice;
     cu.getPartIndexAndSize(partIdx, m_puAbsPartIdx, m_puWidth, m_puHeight);
     m_ctuAddr = cu.m_cuAddr;
     m_cuAbsPartIdx = cuGeom.encodeIdx;
+}
+
+void Predict::prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
+{
+    initMotionCompensation(cu, cuGeom, partIdx);
 
     m_refIdx0      = cu.m_refIdx[0][m_puAbsPartIdx];
     m_clippedMv[0] = cu.m_mv[0][m_puAbsPartIdx];
diff -r da5ba239bf59 -r 1f0b295a6dfa source/common/predict.h
--- a/source/common/predict.h	Wed Oct 29 09:13:25 2014 +0530
+++ b/source/common/predict.h	Wed Oct 29 17:22:21 2014 +0900
@@ -117,6 +117,7 @@
 public:
 
     /* prepMotionCompensation needs to be called to prepare MC with CU-relevant data */
+    void initMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx);
     void prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx);
     void motionCompensation(Yuv& predYuv, bool bLuma, bool bChroma);
 
diff -r da5ba239bf59 -r 1f0b295a6dfa source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Wed Oct 29 09:13:25 2014 +0530
+++ b/source/encoder/analysis.cpp	Wed Oct 29 17:22:21 2014 +0900
@@ -882,7 +882,7 @@
         if (m_bTryLossless)
             tryLossless(cuGeom);
 
-        if (mightSplit && m_param->rdLevel > 1)
+        if (mightSplit)
             addSplitFlagCost(*md.bestMode, cuGeom.depth);
     }
 
@@ -934,7 +934,7 @@
         if (mightNotSplit)
             addSplitFlagCost(*splitPred, cuGeom.depth);
         else if (m_param->rdLevel <= 1)
-            splitPred->sa8dCost = m_rdCost.calcRdSADCost(splitPred->distortion, splitPred->totalBits);
+            splitPred->sa8dCost = m_rdCost.calcRdSADCost(splitPred->distortion, splitPred->sa8dBits);
         else
             updateModeCost(*splitPred);
 
@@ -1539,6 +1539,7 @@
     intraMode.totalBits = bbits;
     intraMode.distortion = bsad;
     intraMode.sa8dCost = bcost;
+    intraMode.sa8dBits = bbits;
 }
 
 void Analysis::encodeIntraInInter(Mode& intraMode, const CUGeom& cuGeom)
diff -r da5ba239bf59 -r 1f0b295a6dfa source/encoder/search.cpp
--- a/source/encoder/search.cpp	Wed Oct 29 09:13:25 2014 +0530
+++ b/source/encoder/search.cpp	Wed Oct 29 17:22:21 2014 +0900
@@ -1728,7 +1728,7 @@
     for (int puIdx = 0; puIdx < numPart; puIdx++)
     {
         /* sets m_puAbsPartIdx, m_puWidth, m_puHeight */
-        prepMotionCompensation(cu, cuGeom, puIdx);
+        initMotionCompensation(cu, cuGeom, puIdx);
 
         pixel* pu = fencPic->getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + m_puAbsPartIdx);
         m_me.setSourcePU(pu - fencPic->m_picOrg[0], m_puWidth, m_puHeight);


More information about the x265-devel mailing list