[x265-commits] [x265] stats: do not crash if no thread pool was used

Steve Borho steve at borho.org
Mon Feb 9 23:53:07 CET 2015


details:   http://hg.videolan.org/x265/rev/b6f36b277234
branches:  
changeset: 9324:b6f36b277234
user:      Steve Borho <steve at borho.org>
date:      Fri Feb 06 21:57:45 2015 -0600
description:
stats: do not crash if no thread pool was used
Subject: [x265] encoder: drop warnings about range extensions

details:   http://hg.videolan.org/x265/rev/ccd8d9d212b2
branches:  stable
changeset: 9325:ccd8d9d212b2
user:      Steve Borho <steve at borho.org>
date:      Sat Feb 07 10:34:03 2015 -0600
description:
encoder: drop warnings about range extensions

These are now official, and our bitstreams are validated against HM 16.3
Subject: [x265] sao: avoid access beyond bounds

details:   http://hg.videolan.org/x265/rev/c5992a3717a9
branches:  stable
changeset: 9326:c5992a3717a9
user:      Praveen Tiwari
date:      Mon Feb 09 17:09:15 2015 +0530
description:
sao: avoid access beyond bounds
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/23e213cb9169
branches:  
changeset: 9327:23e213cb9169
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 11:28:44 2015 -0600
description:
Merge with stable
Subject: [x265] picyuv: nits

details:   http://hg.videolan.org/x265/rev/2a4053ad77da
branches:  
changeset: 9328:2a4053ad77da
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 16:32:44 2015 -0600
description:
picyuv: nits
Subject: [x265] frame: account for pixel size when initializing recon buffers for SAO

details:   http://hg.videolan.org/x265/rev/0d30d2641875
branches:  stable
changeset: 9329:0d30d2641875
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 16:45:18 2015 -0600
description:
frame: account for pixel size when initializing recon buffers for SAO

Prevents uninit read warnings from valgrind at Main10 and non-4:2:0 color spaces
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/da3302cc67fb
branches:  
changeset: 9330:da3302cc67fb
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 16:45:31 2015 -0600
description:
Merge with stable

diffstat:

 source/common/frame.cpp    |   6 +++---
 source/common/picyuv.cpp   |   4 ----
 source/encoder/encoder.cpp |  13 ++++---------
 source/encoder/sao.cpp     |  11 +++++++----
 4 files changed, 14 insertions(+), 20 deletions(-)

diffs (97 lines):

diff -r 12e0b9339d36 -r da3302cc67fb source/common/frame.cpp
--- a/source/common/frame.cpp	Fri Feb 06 12:32:17 2015 -0600
+++ b/source/common/frame.cpp	Mon Feb 09 16:45:31 2015 -0600
@@ -59,9 +59,9 @@ bool Frame::allocEncodeData(x265_param *
         /* initialize right border of m_reconpicYuv as SAO may read beyond the
          * end of the picture accessing uninitialized pixels */
         int maxHeight = sps.numCuInHeight * g_maxCUSize;
-        memset(m_reconPic->m_picOrg[0], 0, m_reconPic->m_stride * maxHeight);
-        memset(m_reconPic->m_picOrg[1], 0, m_reconPic->m_strideC * (maxHeight >> m_reconPic->m_vChromaShift));
-        memset(m_reconPic->m_picOrg[2], 0, m_reconPic->m_strideC * (maxHeight >> m_reconPic->m_vChromaShift));
+        memset(m_reconPic->m_picOrg[0], 0, sizeof(pixel) * m_reconPic->m_stride * maxHeight);
+        memset(m_reconPic->m_picOrg[1], 0, sizeof(pixel) * m_reconPic->m_strideC * (maxHeight >> m_reconPic->m_vChromaShift));
+        memset(m_reconPic->m_picOrg[2], 0, sizeof(pixel) * m_reconPic->m_strideC * (maxHeight >> m_reconPic->m_vChromaShift));
     }
     return ok;
 }
diff -r 12e0b9339d36 -r da3302cc67fb source/common/picyuv.cpp
--- a/source/common/picyuv.cpp	Fri Feb 06 12:32:17 2015 -0600
+++ b/source/common/picyuv.cpp	Mon Feb 09 16:45:31 2015 -0600
@@ -229,9 +229,7 @@ void PicYuv::copyFromPicture(const x265_
         for (int r = 0; r < height; r++)
         {
             for (int x = 0; x < padx; x++)
-            {
                 Y[width + x] = Y[width - 1];
-            }
 
             Y += m_stride;
         }
@@ -257,9 +255,7 @@ void PicYuv::copyFromPicture(const x265_
         pixel *V = m_picOrg[2] + ((height >> m_vChromaShift) - 1) * m_strideC;
 
         for (int i = 1; i <= pady; i++)
-        {
             memcpy(Y + i * m_stride, Y, (width + padx) * sizeof(pixel));
-        }
 
         for (int j = 1; j <= pady >> m_vChromaShift; j++)
         {
diff -r 12e0b9339d36 -r da3302cc67fb source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Feb 06 12:32:17 2015 -0600
+++ b/source/encoder/encoder.cpp	Mon Feb 09 16:45:31 2015 -0600
@@ -919,9 +919,10 @@ void Encoder::printSummary()
              ELAPSED_SEC(totalWorkerTime),
              cuStats.totalCTUs / ELAPSED_SEC(totalWorkerTime));
 
-    x265_log(m_param, X265_LOG_INFO, "CU: %.3lf average worker occupancy, %%%05.2lf of theoretical maximum occupancy\n",
-             (double)totalWorkerTime / elapsedEncodeTime,
-             100.0 * totalWorkerTime / (elapsedEncodeTime * m_threadPool->getThreadCount()));
+    if (m_threadPool)
+        x265_log(m_param, X265_LOG_INFO, "CU: %.3lf average worker occupancy, %%%05.2lf of theoretical maximum occupancy\n",
+                 (double)totalWorkerTime / elapsedEncodeTime,
+                 100.0 * totalWorkerTime / (elapsedEncodeTime * m_threadPool->getThreadCount()));
 
 #undef ELAPSED_SEC
 #undef ELAPSED_MSEC
@@ -1631,12 +1632,6 @@ void Encoder::configure(x265_param *p)
     if (p->totalFrames <= 2 * ((float)p->fpsNum) / p->fpsDenom && p->rc.bStrictCbr)
         p->lookaheadDepth = p->totalFrames;
 
-    if (p->internalCsp != X265_CSP_I420)
-    {
-        x265_log(p, X265_LOG_WARNING, "!! HEVC Range Extension specifications are not finalized !!\n");
-        x265_log(p, X265_LOG_WARNING, "!! This output bitstream may not be compliant with the final spec !!\n");
-    }
-
     if (p->scalingLists && p->internalCsp == X265_CSP_I444)
     {
         x265_log(p, X265_LOG_WARNING, "Scaling lists are not yet supported for 4:4:4 color space\n");
diff -r 12e0b9339d36 -r da3302cc67fb source/encoder/sao.cpp
--- a/source/encoder/sao.cpp	Fri Feb 06 12:32:17 2015 -0600
+++ b/source/encoder/sao.cpp	Mon Feb 09 16:45:31 2015 -0600
@@ -113,8 +113,11 @@ bool SAO::create(x265_param* param)
 
     for (int i = 0; i < 3; i++)
     {
-        CHECKED_MALLOC(m_tmpU1[i], pixel, m_param->sourceWidth);
-        CHECKED_MALLOC(m_tmpU2[i], pixel, m_param->sourceWidth);
+        // SAO asm code will read 1 pixel before and after, so pad by 2
+        CHECKED_MALLOC(m_tmpU1[i], pixel, m_param->sourceWidth + 2);
+        m_tmpU1[i] += 1;
+        CHECKED_MALLOC(m_tmpU2[i], pixel, m_param->sourceWidth + 2);
+        m_tmpU2[i] += 1;
     }
 
     CHECKED_MALLOC(m_count, PerClass, NUM_PLANE);
@@ -150,8 +153,8 @@ void SAO::destroy()
 
     for (int i = 0; i < 3; i++)
     {
-        X265_FREE(m_tmpU1[i]);
-        X265_FREE(m_tmpU2[i]);
+        if (m_tmpU1[i]) X265_FREE(m_tmpU1[i] - 1);
+        if (m_tmpU2[i]) X265_FREE(m_tmpU2[i] - 1);
     }
 
     X265_FREE(m_count);


More information about the x265-commits mailing list