[x265-commits] [x265] slicetype: varname nit

Steve Borho steve at borho.org
Wed Feb 25 04:37:03 CET 2015


details:   http://hg.videolan.org/x265/rev/0f918eb3d13c
branches:  
changeset: 9412:0f918eb3d13c
user:      Steve Borho <steve at borho.org>
date:      Tue Feb 24 20:47:16 2015 -0600
description:
slicetype: varname nit
Subject: [x265] lowres: use CHECKED_MALLOC_ZERO()

details:   http://hg.videolan.org/x265/rev/2c8d0c476a27
branches:  
changeset: 9413:2c8d0c476a27
user:      Steve Borho <steve at borho.org>
date:      Tue Feb 24 21:08:25 2015 -0600
description:
lowres: use CHECKED_MALLOC_ZERO()
Subject: [x265] slicetype: workaround for non-determinism

details:   http://hg.videolan.org/x265/rev/4a90e7e73956
branches:  
changeset: 9414:4a90e7e73956
user:      Steve Borho <steve at borho.org>
date:      Tue Feb 24 21:23:46 2015 -0600
description:
slicetype: workaround for non-determinism
Subject: [x265] slicetype: remove unused intraPenalty flag to batched estimates

details:   http://hg.videolan.org/x265/rev/ce90d8c78ac9
branches:  
changeset: 9415:ce90d8c78ac9
user:      Steve Borho <steve at borho.org>
date:      Tue Feb 24 20:44:20 2015 -0600
description:
slicetype: remove unused intraPenalty flag to batched estimates

diffstat:

 source/common/lowres.cpp     |   5 +----
 source/encoder/slicetype.cpp |  17 ++++++++---------
 source/encoder/slicetype.h   |   3 +--
 3 files changed, 10 insertions(+), 15 deletions(-)

diffs (95 lines):

diff -r 8ba297f59e48 -r ce90d8c78ac9 source/common/lowres.cpp
--- a/source/common/lowres.cpp	Tue Feb 24 14:00:37 2015 -0600
+++ b/source/common/lowres.cpp	Tue Feb 24 20:44:20 2015 -0600
@@ -56,10 +56,7 @@ bool Lowres::create(PicYuv *origPic, int
     CHECKED_MALLOC(propagateCost, uint16_t, cuCount);
 
     /* allocate lowres buffers */
-    CHECKED_MALLOC(buffer[0], pixel, 4 * planesize);
-
-    /* initialize the whole buffer to prevent valgrind warnings on right edge */
-    memset(buffer[0], 0, 4 * sizeof(pixel) * planesize);
+    CHECKED_MALLOC_ZERO(buffer[0], pixel, 4 * planesize);
 
     buffer[1] = buffer[0] + planesize;
     buffer[2] = buffer[1] + planesize;
diff -r 8ba297f59e48 -r ce90d8c78ac9 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Tue Feb 24 14:00:37 2015 -0600
+++ b/source/encoder/slicetype.cpp	Tue Feb 24 20:44:20 2015 -0600
@@ -515,7 +515,7 @@ Lookahead::Lookahead(x265_param *param, 
      * do much unnecessary work, some frame cost estimates are not needed, so if
      * the thread pool is small we disable this feature after the initial burst
      * of work */
-    m_bBatchFrameCosts = m_bBatchMotionSearch;
+    m_bBatchFrameCosts = 0 && m_bBatchMotionSearch; /* temporarily disabled */
 
     if (m_bBatchMotionSearch && m_pool->m_numWorkers > 12)
     {
@@ -1650,10 +1650,10 @@ void Lookahead::estimateCUPropagate(Lowr
     if (!referenced)
         memset(frames[b]->propagateCost, 0, m_widthInCU * sizeof(uint16_t));
 
-    int32_t StrideInCU = m_widthInCU;
+    int32_t strideInCU = m_widthInCU;
     for (uint16_t blocky = 0; blocky < m_heightInCU; blocky++)
     {
-        int cuIndex = blocky * StrideInCU;
+        int cuIndex = blocky * strideInCU;
         primitives.propagateCost(m_scratch, propagateCost,
                                  frames[b]->intraCost + cuIndex, frames[b]->lowresCosts[b - p0][p1 - b] + cuIndex,
                                  frames[b]->invQscaleFactor + cuIndex, &fpsFactor, m_widthInCU);
@@ -1691,10 +1691,10 @@ void Lookahead::estimateCUPropagate(Lowr
                         int32_t y = mvs[list][cuIndex].y;
                         int32_t cux = (x >> 5) + blockx;
                         int32_t cuy = (y >> 5) + blocky;
-                        int32_t idx0 = cux + cuy * StrideInCU;
+                        int32_t idx0 = cux + cuy * strideInCU;
                         int32_t idx1 = idx0 + 1;
-                        int32_t idx2 = idx0 + StrideInCU;
-                        int32_t idx3 = idx0 + StrideInCU + 1;
+                        int32_t idx2 = idx0 + strideInCU;
+                        int32_t idx3 = idx0 + strideInCU + 1;
                         x &= 31;
                         y &= 31;
                         int32_t idx0weight = (32 - y) * (32 - x);
@@ -1796,7 +1796,7 @@ int64_t CostEstimateGroup::singleCost(in
     return estimateFrameCost(tld, p0, p1, b, intraPenalty);
 }
 
-void CostEstimateGroup::add(int p0, int p1, int b, bool intraPenalty)
+void CostEstimateGroup::add(int p0, int p1, int b)
 {
     X265_CHECK(m_batchMode || !m_jobTotal, "single CostEstimateGroup instance cannot mix batch modes\n");
     m_batchMode = true;
@@ -1805,7 +1805,6 @@ void CostEstimateGroup::add(int p0, int 
     e.p0 = p0;
     e.p1 = p1;
     e.b = b;
-    e.bIntraPenalty = intraPenalty;
 
     if (m_jobTotal == MAX_BATCH_SIZE)
         finishBatch();
@@ -1843,7 +1842,7 @@ void CostEstimateGroup::processTasks(int
             ProfileScopeEvent(estCostSingle);
             Estimate& e = m_estimates[i];
 
-            estimateFrameCost(tld, e.p0, e.p1, e.b, e.bIntraPenalty);
+            estimateFrameCost(tld, e.p0, e.p1, e.b, false);
         }
         else
         {
diff -r 8ba297f59e48 -r ce90d8c78ac9 source/encoder/slicetype.h
--- a/source/encoder/slicetype.h	Tue Feb 24 14:00:37 2015 -0600
+++ b/source/encoder/slicetype.h	Tue Feb 24 20:44:20 2015 -0600
@@ -208,10 +208,9 @@ public:
     struct Estimate
     {
         int  p0, b, p1;
-        bool bIntraPenalty;
     } m_estimates[MAX_BATCH_SIZE];
 
-    void add(int p0, int p1, int b, bool intraPenalty = false);
+    void add(int p0, int p1, int b);
     void finishBatch();
 
 protected:


More information about the x265-commits mailing list