[x265-commits] [x265] cudata: make sure per-part buffers are allocate for g_max...

Steve Borho steve at borho.org
Sun Oct 26 04:23:44 CET 2014


details:   http://hg.videolan.org/x265/rev/d3a3d6cad8db
branches:  
changeset: 8674:d3a3d6cad8db
user:      Steve Borho <steve at borho.org>
date:      Sat Oct 25 22:14:50 2014 -0500
description:
cudata: make sure per-part buffers are allocate for g_maxCUSize

There are memsets which rely on the data being consecutive, and for this to
work they have to be the correct length. This fixes some X265_CHECK failures
and possibly some odd behavior with --ctu 32 or --ctu 16
Subject: [x265] cudata: validate subCU size against current analysis depth

details:   http://hg.videolan.org/x265/rev/67d73bffd1fd
branches:  
changeset: 8675:67d73bffd1fd
user:      Steve Borho <steve at borho.org>
date:      Sat Oct 25 22:16:39 2014 -0500
description:
cudata: validate subCU size against current analysis depth

diffstat:

 source/common/cudata.cpp |  4 ++--
 source/common/cudata.h   |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 5186635c0536 -r 67d73bffd1fd source/common/cudata.cpp
--- a/source/common/cudata.cpp	Sat Oct 25 19:02:55 2014 -0500
+++ b/source/common/cudata.cpp	Sat Oct 25 22:16:39 2014 -0500
@@ -158,7 +158,7 @@ void CUData::initialize(const CUDataMemP
     m_chromaFormat  = csp;
     m_hChromaShift  = CHROMA_H_SHIFT(csp);
     m_vChromaShift  = CHROMA_V_SHIFT(csp);
-    m_numPartitions = MAX_NUM_PARTITIONS >> (depth * 2);
+    m_numPartitions = NUM_CU_PARTITIONS >> (depth * 2);
 
     if (!s_partSet[0])
     {
@@ -303,7 +303,6 @@ void CUData::initCTU(const Frame& frame,
 void CUData::initSubCU(const CUData& ctu, const CUGeom& cuGeom)
 {
     m_absIdxInCTU   = cuGeom.encodeIdx;
-    m_numPartitions = cuGeom.numPartitions;
     m_encData       = ctu.m_encData;
     m_slice         = ctu.m_slice;
     m_cuAddr        = ctu.m_cuAddr;
@@ -313,6 +312,7 @@ void CUData::initSubCU(const CUData& ctu
     m_cuAbove       = ctu.m_cuAbove;
     m_cuAboveLeft   = ctu.m_cuAboveLeft;
     m_cuAboveRight  = ctu.m_cuAboveRight;
+    X265_CHECK(m_numPartitions == cuGeom.numPartitions, "initSubCU() size mismatch\n");
 
     /* sequential memsets */
     m_partSet((uint8_t*)m_qp, (uint8_t)ctu.m_qp[0]);
diff -r 5186635c0536 -r 67d73bffd1fd source/common/cudata.h
--- a/source/common/cudata.h	Sat Oct 25 19:02:55 2014 -0500
+++ b/source/common/cudata.h	Sat Oct 25 22:16:39 2014 -0500
@@ -282,7 +282,7 @@ struct CUDataMemPool
 
     bool create(uint32_t depth, uint32_t csp, uint32_t numInstances)
     {
-        uint32_t numPartition = MAX_NUM_PARTITIONS >> (depth * 2);
+        uint32_t numPartition = NUM_CU_PARTITIONS >> (depth * 2);
         uint32_t cuSize = g_maxCUSize >> depth;
         uint32_t sizeL = cuSize * cuSize;
         uint32_t sizeC = sizeL >> (CHROMA_H_SHIFT(csp) + CHROMA_V_SHIFT(csp));


More information about the x265-commits mailing list