[x265-commits] [x265] cugeom: fix uninitialized reported by valgrind

Satoshi Nakagawa nakagawa424 at oki.com
Mon Oct 27 21:08:57 CET 2014


details:   http://hg.videolan.org/x265/rev/3a8f6f685436
branches:  
changeset: 8676:3a8f6f685436
user:      Satoshi Nakagawa <nakagawa424 at oki.com>
date:      Mon Oct 27 13:44:28 2014 +0900
description:
cugeom: fix uninitialized reported by valgrind
Subject: [x265] analysis: cleanup

details:   http://hg.videolan.org/x265/rev/5fd8b40075a6
branches:  
changeset: 8677:5fd8b40075a6
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Oct 27 13:46:34 2014 +0530
description:
analysis: cleanup
Subject: [x265] motion: this emms is required

details:   http://hg.videolan.org/x265/rev/d32f1ad8d061
branches:  
changeset: 8678:d32f1ad8d061
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Oct 27 15:44:06 2014 +0530
description:
motion: this emms is required
Subject: [x265] analysis: motionCompensation(chroma) needs to be performed for asymmetric merge also

details:   http://hg.videolan.org/x265/rev/1b555ddd7667
branches:  
changeset: 8679:1b555ddd7667
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Mon Oct 27 16:43:29 2014 +0530
description:
analysis: motionCompensation(chroma) needs to be performed for asymmetric merge also

This fixes a bug introduced in commit (372a8230110a) for rd2 rect/amp options
Subject: [x265] param: fix w-s spacing in log messages for --rdpenalty and chroma offsets

details:   http://hg.videolan.org/x265/rev/d9ce2644307a
branches:  
changeset: 8680:d9ce2644307a
user:      Steve Borho <steve at borho.org>
date:      Sun Oct 26 10:28:28 2014 -0500
description:
param: fix w-s spacing in log messages for --rdpenalty and chroma offsets

and some nit fixes with braces while I was in the area
Subject: [x265] common: add support for debug breaks in Xcode

details:   http://hg.videolan.org/x265/rev/3e4aee59e21d
branches:  
changeset: 8681:3e4aee59e21d
user:      Steve Borho <steve at borho.org>
date:      Sun Oct 26 17:39:52 2014 -0500
description:
common: add support for debug breaks in Xcode
Subject: [x265] entropy: readability nits

details:   http://hg.videolan.org/x265/rev/78af768201c7
branches:  
changeset: 8682:78af768201c7
user:      Steve Borho <steve at borho.org>
date:      Sun Oct 26 17:58:59 2014 -0500
description:
entropy: readability nits
Subject: [x265] analysis: adding support for --rd 5/6 in compressInterCU_dist() and parallelModeAnalysis()

details:   http://hg.videolan.org/x265/rev/9e221c8530bc
branches:  
changeset: 8683:9e221c8530bc
user:      gopi jayaraman <gopi at multicorewareinc.com>
date:      Fri Oct 24 14:46:14 2014 +0530
description:
analysis: adding support for --rd 5/6 in compressInterCU_dist() and parallelModeAnalysis()
Subject: [x265] analysis: further work on --pmode for --rd 5/6

details:   http://hg.videolan.org/x265/rev/69277ae804d0
branches:  
changeset: 8684:69277ae804d0
user:      Steve Borho <steve at borho.org>
date:      Sat Oct 25 23:16:26 2014 -0500
description:
analysis: further work on --pmode for --rd 5/6

Still needs debugging. The results with --pmode enabled have worse compression
than without, when used with --rd 5. That should be un-possible.
Subject: [x265] analysis: checkIntraInInter_rd0_4() needs the entropy context to be initialized

details:   http://hg.videolan.org/x265/rev/5a3c867cdf57
branches:  
changeset: 8685:5a3c867cdf57
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 08:49:56 2014 -0500
description:
analysis: checkIntraInInter_rd0_4() needs the entropy context to be initialized
Subject: [x265] analysis: invalidate slave entropy contexts, to help find bugs

details:   http://hg.videolan.org/x265/rev/8fd59b57e5e0
branches:  
changeset: 8686:8fd59b57e5e0
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 08:51:40 2014 -0500
description:
analysis: invalidate slave entropy contexts, to help find bugs

this function has no effect in non-checked builds
Subject: [x265] search: further --rd-penalty 2 fixes (refs #71)

details:   http://hg.videolan.org/x265/rev/b0eaff8d1d1a
branches:  
changeset: 8687:b0eaff8d1d1a
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 09:29:57 2014 -0500
description:
search: further --rd-penalty 2 fixes (refs #71)
Subject: [x265] entropy: improve check strings and comments

details:   http://hg.videolan.org/x265/rev/97ca46e10144
branches:  
changeset: 8688:97ca46e10144
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 09:45:03 2014 -0500
description:
entropy: improve check strings and comments
Subject: [x265] docs: update --tu-intra-depth / --tu-inter-depth docs (refs #71)

details:   http://hg.videolan.org/x265/rev/654ea07f93de
branches:  
changeset: 8689:654ea07f93de
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 10:04:35 2014 -0500
description:
docs: update --tu-intra-depth / --tu-inter-depth docs (refs #71)
Subject: [x265] cudata: renames (m_depth, m_trIdx) -> (m_cuDepth, m_tuDepth)

details:   http://hg.videolan.org/x265/rev/288db4430fcd
branches:  
changeset: 8690:288db4430fcd
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 10:31:53 2014 -0500
description:
cudata: renames (m_depth, m_trIdx) -> (m_cuDepth, m_tuDepth)

No behavior changes
Subject: [x265] cudata: setTrIdxSubParts() -> setTUDepthSubParts()

details:   http://hg.videolan.org/x265/rev/a2d70700d53b
branches:  
changeset: 8691:a2d70700d53b
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 10:34:20 2014 -0500
description:
cudata: setTrIdxSubParts() -> setTUDepthSubParts()
Subject: [x265] cudata: remove unused setDepthSubParts

details:   http://hg.videolan.org/x265/rev/9e74e80f2192
branches:  
changeset: 8692:9e74e80f2192
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 10:34:47 2014 -0500
description:
cudata: remove unused setDepthSubParts
Subject: [x265] search: trMode -> tuDepth, improve clarity

details:   http://hg.videolan.org/x265/rev/93a1d11c0a6e
branches:  
changeset: 8693:93a1d11c0a6e
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 10:49:33 2014 -0500
description:
search: trMode -> tuDepth, improve clarity
Subject: [x265] search: fixes for chroma tskip coding with placebo preset

details:   http://hg.videolan.org/x265/rev/453d131f974b
branches:  
changeset: 8694:453d131f974b
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 12:20:10 2014 -0500
description:
search: fixes for chroma tskip coding with placebo preset

Move the tskip decision after the special logic that deals with 4x4 luma, etc
A couple of places where tskip == 0 was implied needed to actually set the flag
Subject: [x265] search: simplify handling of TU size edge case in extractIntraResultChromaQT

details:   http://hg.videolan.org/x265/rev/bea22ebe6af1
branches:  
changeset: 8695:bea22ebe6af1
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 12:36:52 2014 -0500
description:
search: simplify handling of TU size edge case in extractIntraResultChromaQT
Subject: [x265] entropy: nit

details:   http://hg.videolan.org/x265/rev/3abbf77f3c5a
branches:  
changeset: 8696:3abbf77f3c5a
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 12:54:05 2014 -0500
description:
entropy: nit
Subject: [x265] search: use member variable from Predict for csp

details:   http://hg.videolan.org/x265/rev/14ad8ed3792e
branches:  
changeset: 8697:14ad8ed3792e
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 13:33:56 2014 -0500
description:
search: use member variable from Predict for csp

There's no need to derefernece the CU for the color space
Subject: [x265] analysis: defer broadcast sets of merge mv field data until final selection

details:   http://hg.videolan.org/x265/rev/3d5b73b500d4
branches:  
changeset: 8698:3d5b73b500d4
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 14:01:46 2014 -0500
description:
analysis: defer broadcast sets of merge mv field data until final selection

The MC / encode functions do not need for the ME sub-parts to be set. This is
only needed by later neighbor parts
Subject: [x265] analysis: use same MV range check in merge functions

details:   http://hg.videolan.org/x265/rev/07482bd07946
branches:  
changeset: 8699:07482bd07946
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 14:07:30 2014 -0500
description:
analysis: use same MV range check in merge functions
Subject: [x265] analysis: in RD 5/6 ignore redundant merge candidates

details:   http://hg.videolan.org/x265/rev/f5f26b4b6487
branches:  
changeset: 8700:f5f26b4b6487
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 14:31:55 2014 -0500
description:
analysis: in RD 5/6 ignore redundant merge candidates
Subject: [x265] predict: cache color space dimension shifts, use in search.cpp

details:   http://hg.videolan.org/x265/rev/c36cfbbb7133
branches:  
changeset: 8701:c36cfbbb7133
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 14:59:12 2014 -0500
description:
predict: cache color space dimension shifts, use in search.cpp
Subject: [x265] search: leave a helpful comment to avoid unfortunate reordering

details:   http://hg.videolan.org/x265/rev/26e1574a5424
branches:  
changeset: 8702:26e1574a5424
user:      Steve Borho <steve at borho.org>
date:      Mon Oct 27 15:06:04 2014 -0500
description:
search: leave a helpful comment to avoid unfortunate reordering

diffstat:

 doc/reST/cli.rst                |   31 ++-
 source/common/common.h          |    2 +
 source/common/cudata.cpp        |   34 +-
 source/common/cudata.h          |   11 +-
 source/common/deblock.cpp       |   10 +-
 source/common/param.cpp         |   22 +-
 source/common/predict.cpp       |   54 ++--
 source/common/predict.h         |    2 +
 source/common/quant.cpp         |    4 +-
 source/encoder/analysis.cpp     |  416 +++++++++++++++++++++++-----------
 source/encoder/entropy.cpp      |   57 ++--
 source/encoder/frameencoder.cpp |    9 +-
 source/encoder/framefilter.cpp  |    2 +-
 source/encoder/motion.cpp       |    1 +
 source/encoder/search.cpp       |  471 ++++++++++++++++++---------------------
 source/encoder/search.h         |    4 +-
 16 files changed, 616 insertions(+), 514 deletions(-)

diffs (truncated from 2553 to 300 lines):

diff -r 67d73bffd1fd -r 26e1574a5424 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Sat Oct 25 22:16:39 2014 -0500
+++ b/doc/reST/cli.rst	Mon Oct 27 15:06:04 2014 -0500
@@ -439,7 +439,13 @@ Quad-Tree analysis
 	as the coding unit quad-tree, but the encoder may decide to further
 	split the transform unit tree if it improves compression efficiency.
 	This setting limits the number of extra recursion depth which can be
-	attempted for intra coded units. Default: 1
+	attempted for intra coded units. Default: 1, which means the
+	residual quad-tree is always at the same depth as the coded unit
+	quad-tree
+	
+	Note that when the CU intra prediction is NxN (only possible with
+	8x8 CUs), a TU split is implied, and thus the residual quad-tree
+	begins at 4x4 and cannot split any futhrer.
 
 .. option:: --tu-inter-depth <1..4>
 
@@ -447,7 +453,11 @@ Quad-Tree analysis
 	as the coding unit quad-tree, but the encoder may decide to further
 	split the transform unit tree if it improves compression efficiency.
 	This setting limits the number of extra recursion depth which can be
-	attempted for inter coded units. Default: 1
+	attempted for inter coded units. Default: 1. which means the
+	residual quad-tree is always at the same depth as the coded unit
+	quad-tree unless the CU was coded with rectangular or AMP
+	partitions, in which case a TU split is implied and thus the
+	residual quad-tree begins one layer below the CU quad-tree.
 
 Temporal / motion search options
 ================================
@@ -527,11 +537,24 @@ Spatial/intra options
 	or B slices.
 
 	When set to 2, transform units of size 32x32 are not even attempted,
-	unless otherwise required by the maximum recursion depth.
+	unless otherwise required by the maximum recursion depth.  For this
+	option to be effective with 32x32 intra CUs,
+	:option:`--tu-intra-depth` must be at least 2.  For it to be
+	effective with 64x64 intra CUs, :option:`--tu-intra-depth` must be
+	at least 3.
+
+	Note that in HEVC an intra transform unit (a block of the residual
+	quad-tree) is also a prediction unit, meaning that the intra
+	prediction signal is generated for each TU block, the residual
+	subtracted and then coded. The coding unit simply provides the
+	prediction modes that will be used when predicting all of the
+	transform units within the CU. This means that when you prevent
+	32x32 intra transform units, you are preventing 32x32 intra
+	predictions.
 
 	Default 0, disabled.
 
-	**Values:** 0:disabled 1:RD-penalty 2:maximum
+	**Values:** 0:disabled 1:4x cost penalty 2:force splits
 
 .. option:: --b-intra, --no-b-intra
 
diff -r 67d73bffd1fd -r 26e1574a5424 source/common/common.h
--- a/source/common/common.h	Sat Oct 25 22:16:39 2014 -0500
+++ b/source/common/common.h	Mon Oct 27 15:06:04 2014 -0500
@@ -76,6 +76,8 @@ extern "C" intptr_t x265_stack_align(voi
 
 #if _DEBUG && defined(_MSC_VER)
 #define DEBUG_BREAK() __debugbreak()
+#elif __APPLE_CC__
+#define DEBUG_BREAK() __builtin_trap();
 #else
 #define DEBUG_BREAK()
 #endif
diff -r 67d73bffd1fd -r 26e1574a5424 source/common/cudata.cpp
--- a/source/common/cudata.cpp	Sat Oct 25 22:16:39 2014 -0500
+++ b/source/common/cudata.cpp	Mon Oct 27 15:06:04 2014 -0500
@@ -234,13 +234,13 @@ void CUData::initialize(const CUDataMemP
     m_tqBypass           = charBuf; charBuf += m_numPartitions;
     m_refIdx[0]   = (char*)charBuf; charBuf += m_numPartitions;
     m_refIdx[1]   = (char*)charBuf; charBuf += m_numPartitions;
-    m_depth              = charBuf; charBuf += m_numPartitions;
+    m_cuDepth            = charBuf; charBuf += m_numPartitions;
     m_skipFlag           = charBuf; charBuf += m_numPartitions; /* the order up to here is important in initCTU() and initSubCU() */
     m_mergeFlag          = charBuf; charBuf += m_numPartitions;
     m_interDir           = charBuf; charBuf += m_numPartitions;
     m_mvpIdx[0]          = charBuf; charBuf += m_numPartitions;
     m_mvpIdx[1]          = charBuf; charBuf += m_numPartitions;
-    m_trIdx              = charBuf; charBuf += m_numPartitions;
+    m_tuDepth            = charBuf; charBuf += m_numPartitions;
     m_transformSkip[0]   = charBuf; charBuf += m_numPartitions;
     m_transformSkip[1]   = charBuf; charBuf += m_numPartitions;
     m_transformSkip[2]   = charBuf; charBuf += m_numPartitions;
@@ -290,7 +290,7 @@ void CUData::initCTU(const Frame& frame,
     X265_CHECK(!(frame.m_encData->m_param->bLossless && !m_slice->m_pps->bTransquantBypassEnabled), "lossless enabled without TQbypass in PPS\n");
 
     /* initialize the remaining CU data in one memset */
-    memset(m_depth, 0, (BytesPerPartition - 8) * m_numPartitions);
+    memset(m_cuDepth, 0, (BytesPerPartition - 8) * m_numPartitions);
 
     uint32_t widthInCU = m_slice->m_sps->numCuInWidth;
     m_cuLeft = (m_cuAddr % widthInCU) ? m_encData->getPicCTU(m_cuAddr - 1) : NULL;
@@ -323,7 +323,7 @@ void CUData::initSubCU(const CUData& ctu
     m_partSet(m_tqBypass,     (uint8_t)m_encData->m_param->bLossless);
     m_partSet((uint8_t*)m_refIdx[0], (uint8_t)REF_NOT_VALID);
     m_partSet((uint8_t*)m_refIdx[1], (uint8_t)REF_NOT_VALID);
-    m_partSet(m_depth,        (uint8_t)cuGeom.depth);
+    m_partSet(m_cuDepth,      (uint8_t)cuGeom.depth);
 
     /* initialize the remaining CU data in one memset */
     memset(m_skipFlag, 0, (BytesPerPartition - 9) * m_numPartitions);
@@ -344,13 +344,13 @@ void CUData::copyPartFrom(const CUData& 
     m_subPartCopy(m_tqBypass + offset, subCU.m_tqBypass);
     m_subPartCopy((uint8_t*)m_refIdx[0] + offset, (uint8_t*)subCU.m_refIdx[0]);
     m_subPartCopy((uint8_t*)m_refIdx[1] + offset, (uint8_t*)subCU.m_refIdx[1]);
-    m_subPartCopy(m_depth + offset, subCU.m_depth);
+    m_subPartCopy(m_cuDepth + offset, subCU.m_cuDepth);
     m_subPartCopy(m_skipFlag + offset, subCU.m_skipFlag);
     m_subPartCopy(m_mergeFlag + offset, subCU.m_mergeFlag);
     m_subPartCopy(m_interDir + offset, subCU.m_interDir);
     m_subPartCopy(m_mvpIdx[0] + offset, subCU.m_mvpIdx[0]);
     m_subPartCopy(m_mvpIdx[1] + offset, subCU.m_mvpIdx[1]);
-    m_subPartCopy(m_trIdx + offset, subCU.m_trIdx);
+    m_subPartCopy(m_tuDepth + offset, subCU.m_tuDepth);
     m_subPartCopy(m_transformSkip[0] + offset, subCU.m_transformSkip[0]);
     m_subPartCopy(m_transformSkip[1] + offset, subCU.m_transformSkip[1]);
     m_subPartCopy(m_transformSkip[2] + offset, subCU.m_transformSkip[2]);
@@ -379,7 +379,7 @@ void CUData::copyPartFrom(const CUData& 
 void CUData::setEmptyPart(const CUGeom& childGeom, uint32_t subPartIdx)
 {
     uint32_t offset = childGeom.numPartitions * subPartIdx;
-    m_subPartSet(m_depth + offset, (uint8_t)childGeom.depth);
+    m_subPartSet(m_cuDepth + offset, (uint8_t)childGeom.depth);
     m_subPartSet(m_log2CUSize + offset, (uint8_t)childGeom.log2CUSize);
 }
 
@@ -410,7 +410,7 @@ void CUData::initLosslessCU(const CUData
 
     /* clear residual coding flags */
     m_partSet(m_skipFlag, 0);
-    m_partSet(m_trIdx, 0);
+    m_partSet(m_tuDepth, 0);
     m_partSet(m_transformSkip[0], 0);
     m_partSet(m_transformSkip[1], 0);
     m_partSet(m_transformSkip[2], 0);
@@ -432,13 +432,13 @@ void CUData::copyToPic(uint32_t depth) c
     m_partCopy(ctu.m_tqBypass + m_absIdxInCTU, m_tqBypass);
     m_partCopy((uint8_t*)ctu.m_refIdx[0] + m_absIdxInCTU, (uint8_t*)m_refIdx[0]);
     m_partCopy((uint8_t*)ctu.m_refIdx[1] + m_absIdxInCTU, (uint8_t*)m_refIdx[1]);
-    m_partCopy(ctu.m_depth + m_absIdxInCTU, m_depth);
+    m_partCopy(ctu.m_cuDepth + m_absIdxInCTU, m_cuDepth);
     m_partCopy(ctu.m_skipFlag + m_absIdxInCTU, m_skipFlag);
     m_partCopy(ctu.m_mergeFlag + m_absIdxInCTU, m_mergeFlag);
     m_partCopy(ctu.m_interDir + m_absIdxInCTU, m_interDir);
     m_partCopy(ctu.m_mvpIdx[0] + m_absIdxInCTU, m_mvpIdx[0]);
     m_partCopy(ctu.m_mvpIdx[1] + m_absIdxInCTU, m_mvpIdx[1]);
-    m_partCopy(ctu.m_trIdx + m_absIdxInCTU, m_trIdx);
+    m_partCopy(ctu.m_tuDepth + m_absIdxInCTU, m_tuDepth);
     m_partCopy(ctu.m_transformSkip[0] + m_absIdxInCTU, m_transformSkip[0]);
     m_partCopy(ctu.m_transformSkip[1] + m_absIdxInCTU, m_transformSkip[1]);
     m_partCopy(ctu.m_transformSkip[2] + m_absIdxInCTU, m_transformSkip[2]);
@@ -482,7 +482,7 @@ void CUData::copyFromPic(const CUData& c
     m_partCopy(m_tqBypass,     ctu.m_tqBypass + m_absIdxInCTU);
     m_partCopy((uint8_t*)m_refIdx[0], (uint8_t*)ctu.m_refIdx[0] + m_absIdxInCTU);
     m_partCopy((uint8_t*)m_refIdx[1], (uint8_t*)ctu.m_refIdx[1] + m_absIdxInCTU);
-    m_partCopy(m_depth,        ctu.m_depth + m_absIdxInCTU);
+    m_partCopy(m_cuDepth,      ctu.m_cuDepth + m_absIdxInCTU);
     m_partCopy(m_mergeFlag,    ctu.m_mergeFlag + m_absIdxInCTU);
     m_partCopy(m_interDir,     ctu.m_interDir + m_absIdxInCTU);
     m_partCopy(m_mvpIdx[0],    ctu.m_mvpIdx[0] + m_absIdxInCTU);
@@ -496,7 +496,7 @@ void CUData::copyFromPic(const CUData& c
 
     /* clear residual coding flags */
     m_partSet(m_skipFlag, 0);
-    m_partSet(m_trIdx, 0);
+    m_partSet(m_tuDepth, 0);
     m_partSet(m_transformSkip[0], 0);
     m_partSet(m_transformSkip[1], 0);
     m_partSet(m_transformSkip[2], 0);
@@ -515,7 +515,7 @@ void CUData::updatePic(uint32_t depth) c
     m_partCopy(ctu.m_transformSkip[1] + m_absIdxInCTU, m_transformSkip[1]);
     m_partCopy(ctu.m_transformSkip[2] + m_absIdxInCTU, m_transformSkip[2]);
     m_partCopy(ctu.m_skipFlag + m_absIdxInCTU, m_skipFlag);
-    m_partCopy(ctu.m_trIdx + m_absIdxInCTU, m_trIdx);
+    m_partCopy(ctu.m_tuDepth + m_absIdxInCTU, m_tuDepth);
     m_partCopy(ctu.m_cbf[0] + m_absIdxInCTU, m_cbf[0]);
     m_partCopy(ctu.m_cbf[1] + m_absIdxInCTU, m_cbf[1]);
     m_partCopy(ctu.m_cbf[2] + m_absIdxInCTU, m_cbf[2]);
@@ -799,7 +799,7 @@ int CUData::getLastValidPartIdx(int absP
 
     while (lastValidPartIdx >= 0 && m_predMode[lastValidPartIdx] == MODE_NONE)
     {
-        uint32_t depth = m_depth[lastValidPartIdx];
+        uint32_t depth = m_cuDepth[lastValidPartIdx];
         lastValidPartIdx -= m_numPartitions >> (depth << 1);
     }
 
@@ -899,11 +899,11 @@ uint32_t CUData::getCtxSplitFlag(uint32_
 
     // Get left split flag
     tempCU = getPULeft(tempPartIdx, m_absIdxInCTU + absPartIdx);
-    ctx  = (tempCU) ? ((tempCU->m_depth[tempPartIdx] > depth) ? 1 : 0) : 0;
+    ctx  = (tempCU) ? ((tempCU->m_cuDepth[tempPartIdx] > depth) ? 1 : 0) : 0;
 
     // Get above split flag
     tempCU = getPUAbove(tempPartIdx, m_absIdxInCTU + absPartIdx);
-    ctx += (tempCU) ? ((tempCU->m_depth[tempPartIdx] > depth) ? 1 : 0) : 0;
+    ctx += (tempCU) ? ((tempCU->m_cuDepth[tempPartIdx] > depth) ? 1 : 0) : 0;
 
     return ctx;
 }
@@ -944,7 +944,7 @@ bool CUData::setQPSubCUs(char qp, uint32
     uint32_t curPartNumb = NUM_CU_PARTITIONS >> (depth << 1);
     uint32_t curPartNumQ = curPartNumb >> 2;
 
-    if (m_depth[absPartIdx] > depth)
+    if (m_cuDepth[absPartIdx] > depth)
     {
         for (uint32_t subPartIdx = 0; subPartIdx < 4; subPartIdx++)
             if (setQPSubCUs(qp, absPartIdx + subPartIdx * curPartNumQ, depth + 1))
diff -r 67d73bffd1fd -r 26e1574a5424 source/common/cudata.h
--- a/source/common/cudata.h	Sat Oct 25 22:16:39 2014 -0500
+++ b/source/common/cudata.h	Mon Oct 27 15:06:04 2014 -0500
@@ -76,8 +76,8 @@ struct CUGeom
         SPLIT           = 1<<4, // CU is currently split in four child CUs.
     };
     
-    // (1 + 4 + 16 + 64) + (1 + 8 + 1 + 8 + 1) = 104.
-    enum { MAX_GEOMS = 104 };
+    // (1 + 4 + 16 + 64) = 85.
+    enum { MAX_GEOMS = 85 };
 
     uint32_t log2CUSize;    // Log of the CU size.
     uint32_t childOffset;   // offset of the first child CU from current CU
@@ -133,12 +133,12 @@ public:
     uint8_t*      m_lumaIntraDir;     // array of intra directions (luma)
     uint8_t*      m_tqBypass;         // array of CU lossless flags
     char*         m_refIdx[2];        // array of motion reference indices per list
-    uint8_t*      m_depth;            // array of depths
+    uint8_t*      m_cuDepth;          // array of depths
     uint8_t*      m_skipFlag;         // array of skip flags
     uint8_t*      m_mergeFlag;        // array of merge flags
     uint8_t*      m_interDir;         // array of inter directions
     uint8_t*      m_mvpIdx[2];        // array of motion vector predictor candidates or merge candidate indices [0]
-    uint8_t*      m_trIdx;            // array of transform indices
+    uint8_t*      m_tuDepth;          // array of transform indices
     uint8_t*      m_transformSkip[3]; // array of transform skipping flags per plane
     uint8_t*      m_cbf[3];           // array of coded block flags (CBF) per plane
     uint8_t*      m_chromaIntraDir;   // array of intra directions (chroma)
@@ -172,7 +172,6 @@ public:
     void     copyFromPic(const CUData& ctu, const CUGeom& cuGeom);
     void     updatePic(uint32_t depth) const;
 
-    void     setDepthSubParts(uint8_t depth)       { m_partSet(m_depth, depth); }
     void     setPartSizeSubParts(PartSize size)    { m_partSet(m_partSize, (uint8_t)size); }
     void     setSkipFlagSubParts(uint8_t skipFlag) { m_partSet(m_skipFlag, skipFlag); }
     void     setPredModeSubParts(PredMode mode)    { m_partSet(m_predMode, (uint8_t)mode); }
@@ -180,7 +179,7 @@ public:
 
     /* these functions all take depth as an absolute depth from CTU, it is used to calculate the number of parts to copy */
     void     setQPSubParts(char qp, uint32_t absPartIdx, uint32_t depth)                      { s_partSet[depth]((uint8_t*)m_qp + absPartIdx, (uint8_t)qp); }
-    void     setTrIdxSubParts(uint8_t trIdx, uint32_t absPartIdx, uint32_t depth)             { s_partSet[depth](m_trIdx + absPartIdx, trIdx); }
+    void     setTUDepthSubParts(uint8_t tuDepth, uint32_t absPartIdx, uint32_t depth)         { s_partSet[depth](m_tuDepth + absPartIdx, tuDepth); }
     void     setLumaIntraDirSubParts(uint8_t dir, uint32_t absPartIdx, uint32_t depth)        { s_partSet[depth](m_lumaIntraDir + absPartIdx, dir); }
     void     setChromIntraDirSubParts(uint8_t dir, uint32_t absPartIdx, uint32_t depth)       { s_partSet[depth](m_chromaIntraDir + absPartIdx, dir); }
     void     setCbfSubParts(uint8_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t depth) { s_partSet[depth](m_cbf[ttype] + absPartIdx, cbf); }
diff -r 67d73bffd1fd -r 26e1574a5424 source/common/deblock.cpp
--- a/source/common/deblock.cpp	Sat Oct 25 22:16:39 2014 -0500
+++ b/source/common/deblock.cpp	Mon Oct 27 15:06:04 2014 -0500
@@ -53,7 +53,7 @@ void Deblock::deblockCU(CUData* cu, uint
 
     const SPS& sps = *cu->m_slice->m_sps;
 
-    if (cu->m_depth[absPartIdx] > depth)
+    if (cu->m_cuDepth[absPartIdx] > depth)
     {
         uint32_t qNumParts   = curNumParts >> 2;
         uint32_t xmax = sps.picWidthInLumaSamples  - cu->m_cuPelX;
@@ -116,7 +116,7 @@ void Deblock::setEdgefilterMultiple(CUDa
 
 void Deblock::setEdgefilterTU(CUData* cu, uint32_t absPartIdx, uint32_t depth, int32_t dir, uint8_t blockingStrength[])
 {
-    if ((uint32_t)cu->m_trIdx[absPartIdx] + cu->m_depth[absPartIdx] > depth)
+    if ((uint32_t)cu->m_tuDepth[absPartIdx] + cu->m_cuDepth[absPartIdx] > depth)
     {
         const uint32_t curNumParts = NUM_CU_PARTITIONS >> (depth << 1);
         const uint32_t qNumParts   = curNumParts >> 2;
@@ -126,7 +126,7 @@ void Deblock::setEdgefilterTU(CUData* cu
         return;
     }
 
-    uint32_t widthInBaseUnits  = 1 << (cu->m_log2CUSize[absPartIdx] - cu->m_trIdx[absPartIdx] - LOG2_UNIT_SIZE);
+    uint32_t widthInBaseUnits  = 1 << (cu->m_log2CUSize[absPartIdx] - cu->m_tuDepth[absPartIdx] - LOG2_UNIT_SIZE);
     setEdgefilterMultiple(cu, absPartIdx, dir, 0, 2, blockingStrength, widthInBaseUnits);
 }
 
@@ -229,8 +229,8 @@ void Deblock::getBoundaryStrengthSingle(
         uint32_t nsPartP = partP;
 
         if (blockingStrength[absPartIdx] > 1 &&
-            (cuQ->getCbf(nsPartQ, TEXT_LUMA, cuQ->m_trIdx[nsPartQ]) ||
-             cuP->getCbf(nsPartP, TEXT_LUMA, cuP->m_trIdx[nsPartP])))
+            (cuQ->getCbf(nsPartQ, TEXT_LUMA, cuQ->m_tuDepth[nsPartQ]) ||
+             cuP->getCbf(nsPartP, TEXT_LUMA, cuP->m_tuDepth[nsPartP])))


More information about the x265-commits mailing list