[x265] [PATCH] TComDataCU: Reduced repeated function call to calculate depth range

ashok at multicorewareinc.com ashok at multicorewareinc.com
Tue Sep 2 17:11:22 CEST 2014


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1409670653 -19800
#      Tue Sep 02 20:40:53 2014 +0530
# Node ID 82c8be4731690651ee008110452d6b5f0e2a6e86
# Parent  62c4779fb0bb35d5d8a69678e9e8aa81272f0115
TComDataCU: Reduced repeated function call to calculate depth range

diff -r 62c4779fb0bb -r 82c8be473169 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Tue Sep 02 20:40:53 2014 +0530
@@ -1193,32 +1193,18 @@
     return ctx;
 }
 
-uint32_t TComDataCU::getQuadtreeTULog2MinSizeInCU(uint32_t absPartIdx)
+void TComDataCU::getQuadtreeTULog2MinSizeInCU(uint32_t tuDepthRange[2], uint32_t absPartIdx)
 {
     uint32_t log2CUSize = getLog2CUSize(absPartIdx);
     PartSize partSize   = getPartitionSize(absPartIdx);
-    uint32_t quadtreeTUMaxDepth = getPredictionMode(absPartIdx) == MODE_INTRA ? m_slice->m_sps->quadtreeTUMaxDepthIntra : m_slice->m_sps->quadtreeTUMaxDepthInter;
-    int intraSplitFlag = (getPredictionMode(absPartIdx) == MODE_INTRA && partSize == SIZE_NxN) ? 1 : 0;
-    int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode(absPartIdx) == MODE_INTER) && (partSize != SIZE_2Nx2N));
+    uint32_t quadtreeTUMaxDepth = getPredictionMode(0) == MODE_INTRA ? m_slice->m_sps->quadtreeTUMaxDepthIntra : m_slice->m_sps->quadtreeTUMaxDepthInter;
+    uint32_t intraSplitFlag = (getPredictionMode(absPartIdx) == MODE_INTRA && partSize == SIZE_NxN) ? 1 : 0;
+    uint32_t interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode(0) == MODE_INTER) && (partSize != SIZE_2Nx2N));
 
-    uint32_t log2MinTUSizeInCU = 0;
+    tuDepthRange[0] = m_slice->m_sps->quadtreeTULog2MinSize;
+    tuDepthRange[1] = m_slice->m_sps->quadtreeTULog2MaxSize;
 
-    if (log2CUSize < (m_slice->m_sps->quadtreeTULog2MinSize + quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag))
-    {
-        // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is < QuadtreeTULog2MinSize
-        log2MinTUSizeInCU = m_slice->m_sps->quadtreeTULog2MinSize;
-    }
-    else
-    {
-        // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is still >= QuadtreeTULog2MinSize
-        log2MinTUSizeInCU = log2CUSize - (quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag); // stop when trafoDepth == hierarchy_depth = splitFlag
-        if (log2MinTUSizeInCU > m_slice->m_sps->quadtreeTULog2MaxSize)
-        {
-            // when fully making use of signaled TUMaxDepth + inter/intraSplitFlag, resulting luma TB size is still > QuadtreeTULog2MaxSize
-            log2MinTUSizeInCU = m_slice->m_sps->quadtreeTULog2MaxSize;
-        }
-    }
-    return log2MinTUSizeInCU;
+    tuDepthRange[0] = X265_MAX(tuDepthRange[0], X265_MIN(log2CUSize - (quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag), tuDepthRange[1]));
 }
 
 uint32_t TComDataCU::getCtxSkipFlag(uint32_t absPartIdx)
diff -r 62c4779fb0bb -r 82c8be473169 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.h	Tue Sep 02 20:40:53 2014 +0530
@@ -359,7 +359,7 @@
     void          setTransformSkipSubParts(uint32_t useTransformSkip, TextType ttype, uint32_t absPartIdx, uint32_t depth);
     void          setTransformSkipSubParts(uint32_t useTransformSkipY, uint32_t useTransformSkipU, uint32_t useTransformSkipV, uint32_t absPartIdx, uint32_t depth);
 
-    uint32_t      getQuadtreeTULog2MinSizeInCU(uint32_t absPartIdx);
+    void          getQuadtreeTULog2MinSizeInCU(uint32_t tuDepthRange[2], uint32_t absPartIdx);
 
     TComCUMvField* getCUMvField(int e)        { return &m_cuMvField[e]; }
 
diff -r 62c4779fb0bb -r 82c8be473169 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Sep 02 20:40:53 2014 +0530
@@ -127,7 +127,7 @@
     return false;
 }
 
-void TEncSearch::xEncSubdivCbfQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx)
+void TEncSearch::xEncSubdivCbfQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t* depthRange)
 {
     uint32_t fullDepth  = cu->getDepth(0) + trDepth;
     uint32_t trMode     = cu->getTransformIdx(absPartIdx);
@@ -138,7 +138,7 @@
     {
         X265_CHECK(subdiv, "subdivision not present\n");
     }
-    else if (log2TrSize > cu->m_slice->m_sps->quadtreeTULog2MaxSize)
+    else if (log2TrSize > *(depthRange + 1))
     {
         X265_CHECK(subdiv, "subdivision not present\n");
     }
@@ -146,13 +146,13 @@
     {
         X265_CHECK(!subdiv, "subdivision present\n");
     }
-    else if (log2TrSize == cu->getQuadtreeTULog2MinSizeInCU(absPartIdx))
+    else if (log2TrSize == *depthRange)
     {
         X265_CHECK(!subdiv, "subdivision present\n");
     }
     else
     {
-        X265_CHECK(log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx), "transform size too small\n");
+        X265_CHECK(log2TrSize > *depthRange, "transform size too small\n");
         m_entropyCoder->codeTransformSubdivFlag(subdiv, 5 - log2TrSize);
     }
 
@@ -160,7 +160,7 @@
     {
         uint32_t qtPartNum = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);
         for (uint32_t part = 0; part < 4; part++)
-            xEncSubdivCbfQTLuma(cu, trDepth + 1, absPartIdx + part * qtPartNum);
+            xEncSubdivCbfQTLuma(cu, trDepth + 1, absPartIdx + part * qtPartNum, depthRange);
 
         return;
     }
@@ -333,11 +333,11 @@
     }
 }
 
-uint32_t TEncSearch::xGetIntraBitsQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx)
+uint32_t TEncSearch::xGetIntraBitsQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t* depthRange)
 {
     m_entropyCoder->resetBits();
     xEncIntraHeaderLuma(cu, trDepth, absPartIdx);
-    xEncSubdivCbfQTLuma(cu, trDepth, absPartIdx);
+    xEncSubdivCbfQTLuma(cu, trDepth, absPartIdx, depthRange);
     xEncCoeffQTLuma(cu, trDepth, absPartIdx);
     return m_entropyCoder->getNumberOfWrittenBits();
 }
@@ -353,11 +353,11 @@
     return m_entropyCoder->getNumberOfWrittenBits();
 }
 
-uint32_t TEncSearch::xGetIntraBitsLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t log2TrSize, coeff_t* coeff)
+uint32_t TEncSearch::xGetIntraBitsLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t log2TrSize, coeff_t* coeff, uint32_t* depthRange)
 {
     m_entropyCoder->resetBits();
     xEncIntraHeaderLuma(cu, trDepth, absPartIdx);
-    xEncSubdivCbfQTLuma(cu, trDepth, absPartIdx);
+    xEncSubdivCbfQTLuma(cu, trDepth, absPartIdx, depthRange);
 
     if (cu->getCbf(absPartIdx, TEXT_LUMA, trDepth))
         m_entropyCoder->codeCoeffNxN(cu, coeff, absPartIdx, log2TrSize, TEXT_LUMA);
@@ -523,12 +523,13 @@
                                      ShortYuv*   resiYuv,
                                      uint32_t&   outDistY,
                                      bool        bCheckFirst,
-                                     uint64_t&   rdCost)
+                                     uint64_t&   rdCost,
+                                     uint32_t*   depthRange)
 {
     uint32_t fullDepth   = cu->getDepth(0) + trDepth;
     uint32_t log2TrSize  = g_maxLog2CUSize - fullDepth;
-    bool     bCheckFull  = (log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize);
-    bool     bCheckSplit = (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx));
+    bool bCheckSplit = log2TrSize > *depthRange;
+    bool bCheckFull  = log2TrSize <= *(depthRange + 1);
 
     int isIntraSlice = (cu->m_slice->m_sliceType == I_SLICE);
 
@@ -640,7 +641,7 @@
                     break;
                 else
                 {
-                    uint32_t singleBits = xGetIntraBitsLuma(cu, trDepth, absPartIdx, log2TrSize, coeff);
+                    uint32_t singleBits = xGetIntraBitsLuma(cu, trDepth, absPartIdx, log2TrSize, coeff, depthRange);
                     if (m_rdCost.m_psyRd)
                         singleCostTmp = m_rdCost.calcPsyRdCost(singleDistYTmp, singleBits, singlePsyEnergyYTmp);
                     else
@@ -694,7 +695,7 @@
             }
             cu->setCbfSubParts(singleCbfY << trDepth, TEXT_LUMA, absPartIdx, fullDepth);
 
-            uint32_t singleBits = xGetIntraBitsLuma(cu, trDepth, absPartIdx, log2TrSize, coeffY);
+            uint32_t singleBits = xGetIntraBitsLuma(cu, trDepth, absPartIdx, log2TrSize, coeffY, depthRange);
             if (m_param->rdPenalty && (log2TrSize == 5) && !isIntraSlice)
                 singleBits *= 4;
 
@@ -728,7 +729,7 @@
         for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)
         {
             cu->m_psyEnergy = 0;
-            xRecurIntraCodingQT(cu, trDepth + 1, absPartIdxSub, fencYuv, predYuv, resiYuv, splitDistY, bCheckFirst, splitCost);
+            xRecurIntraCodingQT(cu, trDepth + 1, absPartIdxSub, fencYuv, predYuv, resiYuv, splitDistY, bCheckFirst, splitCost, depthRange);
 
             splitPsyEnergyY += cu->m_psyEnergy;
             splitCbfY |= cu->getCbf(absPartIdxSub, TEXT_LUMA, trDepth + 1);
@@ -741,7 +742,7 @@
         m_entropyCoder->load(m_rdEntropyCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 
         //----- determine rate and r-d cost -----
-        uint32_t splitBits = xGetIntraBitsQTLuma(cu, trDepth, absPartIdx);
+        uint32_t splitBits = xGetIntraBitsQTLuma(cu, trDepth, absPartIdx, depthRange);
         if (m_rdCost.m_psyRd)
             splitCost = m_rdCost.calcPsyRdCost(splitDistY, splitBits, splitPsyEnergyY);
         else
@@ -791,12 +792,13 @@
                                              TComYuv*    fencYuv,
                                              TComYuv*    predYuv,
                                              ShortYuv*   resiYuv,
-                                             TComYuv*    reconYuv)
+                                             TComYuv*    reconYuv,
+                                             uint32_t*   depthRange)
 {
     uint32_t fullDepth   = cu->getDepth(0) +  trDepth;
     uint32_t log2TrSize  = g_maxLog2CUSize - fullDepth;
-    bool     bCheckFull  = (log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize);
-    bool     bCheckSplit = (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx));
+    bool     bCheckFull  = (log2TrSize <= *(depthRange + 1));
+    bool     bCheckSplit = (log2TrSize > *depthRange);
 
     int isIntraSlice = (cu->m_slice->m_sliceType == I_SLICE);
 
@@ -881,7 +883,7 @@
 
         for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)
         {
-            residualTransformQuantIntra(cu, trDepth + 1, absPartIdxSub, fencYuv, predYuv, resiYuv, reconYuv);
+            residualTransformQuantIntra(cu, trDepth + 1, absPartIdxSub, fencYuv, predYuv, resiYuv, reconYuv, depthRange);
             splitCbfY |= cu->getCbf(absPartIdxSub, TEXT_LUMA, trDepth + 1);
         }
 
@@ -1360,7 +1362,7 @@
     }
 }
 
-void TEncSearch::estIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv)
+void TEncSearch::estIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv, uint32_t* depthRange)
 {
     uint32_t depth        = cu->getDepth(0);
     uint32_t initTrDepth  = cu->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
@@ -1524,7 +1526,7 @@
             // determine residual for partition
             uint32_t puDistY = 0;
             uint64_t puCost  = 0;
-            xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, puDistY, true, puCost);
+            xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, puDistY, true, puCost, depthRange);
 
             // check r-d cost
             if (puCost < bestPUCost)
@@ -1553,7 +1555,7 @@
             // determine residual for partition
             uint32_t puDistY = 0;
             uint64_t puCost  = 0;
-            xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, puDistY, false, puCost);
+            xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, puDistY, false, puCost, depthRange);
 
             // check r-d cost
             if (puCost < bestPUCost)
@@ -2323,6 +2325,9 @@
         numModes = 2;
     }
 
+    uint32_t tuDepthRange[2];
+    cu->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
+
     uint64_t bestCost = MAX_INT64;
     uint32_t bestMode = 0;
 
@@ -2338,7 +2343,7 @@
         uint32_t distortion = 0;
 
         m_entropyCoder->load(m_rdEntropyCoders[depth][CI_CURR_BEST]);
-        xEstimateResidualQT(cu, 0, fencYuv, predYuv, outResiYuv, depth, cost, bits, distortion, &zeroDistortion);
+        xEstimateResidualQT(cu, 0, fencYuv, predYuv, outResiYuv, depth, cost, bits, distortion, &zeroDistortion, tuDepthRange);
 
         m_entropyCoder->resetBits();
         m_entropyCoder->codeQtRootCbfZero(cu);
@@ -2380,7 +2385,7 @@
 
         m_entropyCoder->load(m_rdEntropyCoders[depth][CI_CURR_BEST]);
 
-        bits = xSymbolBitsInter(cu);
+        bits = xSymbolBitsInter(cu, tuDepthRange);
 
         if (m_rdCost.m_psyRd)
             cost = m_rdCost.calcPsyRdCost(distortion, bits, cu->m_psyEnergy);
@@ -2410,7 +2415,7 @@
         uint32_t zeroDistortion = 0;
         uint32_t bits = 0;
         uint32_t distortion = 0;
-        xEstimateResidualQT(cu, 0, fencYuv, predYuv, outResiYuv, depth, cost, bits, distortion, &zeroDistortion);
+        xEstimateResidualQT(cu, 0, fencYuv, predYuv, outResiYuv, depth, cost, bits, distortion, &zeroDistortion, tuDepthRange);
         xSetResidualQTData(cu, 0, NULL, depth, false);
         m_entropyCoder->store(m_rdEntropyCoders[depth][CI_TEMP_BEST]);
     }
@@ -2449,9 +2454,12 @@
 {
     m_quant.setQPforQuant(cu);
 
+    uint32_t tuDepthRange[2];
+    cu->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
+
     if (cu->getPredictionMode(0) == MODE_INTER)
     {
-        residualTransformQuantInter(cu, 0, fencYuv, resiYuv, cu->getDepth(0));
+        residualTransformQuantInter(cu, 0, fencYuv, resiYuv, cu->getDepth(0), tuDepthRange);
         if (cu->getQtRootCbf(0))
             reconYuv->addClip(predYuv, resiYuv, cu->getLog2CUSize(0));
         else
@@ -2464,13 +2472,13 @@
     else if (cu->getPredictionMode(0) == MODE_INTRA)
     {
         uint32_t initTrDepth = cu->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
-        residualTransformQuantIntra(cu, initTrDepth, 0, fencYuv, predYuv, resiYuv, reconYuv);
+        residualTransformQuantIntra(cu, initTrDepth, 0, fencYuv, predYuv, resiYuv, reconYuv, tuDepthRange);
         getBestIntraModeChroma(cu, fencYuv, predYuv);
         residualQTIntrachroma(cu, 0, 0, fencYuv, predYuv, resiYuv, reconYuv);
     }
 }
 
-void TEncSearch::residualTransformQuantInter(TComDataCU* cu, uint32_t absPartIdx, TComYuv* fencYuv, ShortYuv* resiYuv, const uint32_t depth)
+void TEncSearch::residualTransformQuantInter(TComDataCU* cu, uint32_t absPartIdx, TComYuv* fencYuv, ShortYuv* resiYuv, const uint32_t depth, uint32_t* depthRange)
 {
     X265_CHECK(cu->getDepth(0) == cu->getDepth(absPartIdx), "invalid depth\n");
     const uint32_t trMode = depth - cu->getDepth(0);
@@ -2481,11 +2489,11 @@
 
     bool bSplitFlag = ((cu->m_slice->m_sps->quadtreeTUMaxDepthInter == 1) && cu->getPredictionMode(absPartIdx) == MODE_INTER && (cu->getPartitionSize(absPartIdx) != SIZE_2Nx2N));
     bool bCheckFull;
-    if (bSplitFlag && depth == cu->getDepth(absPartIdx) && (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx)))
+    if (bSplitFlag && depth == cu->getDepth(absPartIdx) && (log2TrSize > *depthRange))
         bCheckFull = false;
     else
-        bCheckFull = (log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize);
-    const bool bCheckSplit = (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx));
+        bCheckFull = (log2TrSize <= *(depthRange + 1));
+    const bool bCheckSplit = (log2TrSize > *depthRange);
     X265_CHECK(bCheckFull || bCheckSplit, "check-full or check-split must be set\n");
 
     // code full block
@@ -2580,7 +2588,7 @@
     {
         const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);
         for (uint32_t i = 0; i < 4; ++i)
-            residualTransformQuantInter(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, resiYuv, depth + 1);
+            residualTransformQuantInter(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, resiYuv, depth + 1, depthRange);
 
         uint32_t ycbf = 0;
         uint32_t ucbf = 0;
@@ -2607,10 +2615,11 @@
                                      TComYuv*       predYuv,
                                      ShortYuv*      resiYuv,
                                      const uint32_t depth,
-                                     uint64_t &     rdCost,
-                                     uint32_t &     outBits,
-                                     uint32_t &     outDist,
-                                     uint32_t *     outZeroDist)
+                                     uint64_t&      rdCost,
+                                     uint32_t&      outBits,
+                                     uint32_t&      outDist,
+                                     uint32_t*      outZeroDist,
+                                     uint32_t*      depthRange)
 {
     X265_CHECK(cu->getDepth(0) == cu->getDepth(absPartIdx), "depth not matching\n");
     const uint32_t trMode = depth - cu->getDepth(0);
@@ -2622,11 +2631,12 @@
 
     bool bSplitFlag = ((cu->m_slice->m_sps->quadtreeTUMaxDepthInter == 1) && cu->getPredictionMode(absPartIdx) == MODE_INTER && (cu->getPartitionSize(absPartIdx) != SIZE_2Nx2N));
     bool bCheckFull;
-    if (bSplitFlag && depth == cu->getDepth(absPartIdx) && (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx)))
+    if (bSplitFlag && depth == cu->getDepth(absPartIdx) && (log2TrSize > *depthRange))
         bCheckFull = false;
     else
-        bCheckFull = (log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize);
-    const bool bCheckSplit = (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx));
+        bCheckFull = (log2TrSize <= *(depthRange + 1));
+    const bool bCheckSplit = (log2TrSize > *depthRange);
+
     X265_CHECK(bCheckFull || bCheckSplit, "check-full or check-split must be set\n");
 
     uint32_t log2TrSizeC = log2TrSize - hChromaShift;
@@ -3228,7 +3238,7 @@
 
         m_entropyCoder->resetBits();
 
-        if (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx))
+        if (log2TrSize > *depthRange)
             m_entropyCoder->codeTransformSubdivFlag(0, 5 - log2TrSize);
 
         if (bCodeChroma)
@@ -3334,7 +3344,7 @@
         for (uint32_t i = 0; i < 4; ++i)
         {
             cu->m_psyEnergy = 0;
-            xEstimateResidualQT(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, predYuv, resiYuv, depth + 1, subDivCost, subdivBits, subdivDist, bCheckFull ? NULL : outZeroDist);
+            xEstimateResidualQT(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, predYuv, resiYuv, depth + 1, subDivCost, subdivBits, subdivDist, bCheckFull ? NULL : outZeroDist, depthRange);
             subDivPsyEnergy += cu->m_psyEnergy;
         }
 
@@ -3358,10 +3368,10 @@
         m_entropyCoder->load(m_rdEntropyCoders[depth][CI_QT_TRAFO_ROOT]);
         m_entropyCoder->resetBits();
 
-        xEncodeResidualQT(cu, absPartIdx, depth, true,  TEXT_LUMA);
-        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_LUMA);
-        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_CHROMA_U);
-        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_CHROMA_V);
+        xEncodeResidualQT(cu, absPartIdx, depth, true,  TEXT_LUMA, depthRange);
+        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_LUMA, depthRange);
+        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_CHROMA_U, depthRange);
+        xEncodeResidualQT(cu, absPartIdx, depth, false, TEXT_CHROMA_V, depthRange);
 
         subdivBits = m_entropyCoder->getNumberOfWrittenBits();
 
@@ -3433,7 +3443,7 @@
     }
 }
 
-void TEncSearch::xEncodeResidualQT(TComDataCU* cu, uint32_t absPartIdx, const uint32_t depth, bool bSubdivAndCbf, TextType ttype)
+void TEncSearch::xEncodeResidualQT(TComDataCU* cu, uint32_t absPartIdx, const uint32_t depth, bool bSubdivAndCbf, TextType ttype, uint32_t* depthRange)
 {
     X265_CHECK(cu->getDepth(0) == cu->getDepth(absPartIdx), "depth not matching\n");
     const uint32_t curTrMode   = depth - cu->getDepth(0);
@@ -3443,11 +3453,11 @@
     int hChromaShift = CHROMA_H_SHIFT(m_csp);
     int vChromaShift = CHROMA_V_SHIFT(m_csp);
 
-    uint32_t       log2TrSizeC = log2TrSize - hChromaShift;
+    uint32_t log2TrSizeC = log2TrSize - hChromaShift;
     
     const bool splitIntoSubTUs = (m_csp == X265_CSP_I422);
 
-    if (bSubdivAndCbf && log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize && log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx))
+    if (bSubdivAndCbf && log2TrSize <= *(depthRange + 1) && log2TrSize > *depthRange)
         m_entropyCoder->codeTransformSubdivFlag(bSubdiv, 5 - log2TrSize);
 
     X265_CHECK(cu->getPredictionMode(absPartIdx) != MODE_INTRA, "xEncodeResidualQT() with intra block\n");
@@ -3544,7 +3554,7 @@
         {
             const uint32_t qpartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);
             for (uint32_t i = 0; i < 4; ++i)
-                xEncodeResidualQT(cu, absPartIdx + i * qpartNumSubdiv, depth + 1, bSubdivAndCbf, ttype);
+                xEncodeResidualQT(cu, absPartIdx + i * qpartNumSubdiv, depth + 1, bSubdivAndCbf, ttype, depthRange);
         }
     }
 }
@@ -3662,7 +3672,7 @@
 /** add inter-prediction syntax elements for a CU block
  * \param cu
  */
-uint32_t TEncSearch::xSymbolBitsInter(TComDataCU* cu)
+uint32_t TEncSearch::xSymbolBitsInter(TComDataCU* cu, uint32_t* depthRange)
 {
     if (cu->getMergeFlag(0) && cu->getPartitionSize(0) == SIZE_2Nx2N && !cu->getQtRootCbf(0))
     {
@@ -3692,7 +3702,7 @@
         m_entropyCoder->codePredInfo(cu, 0);
         bool bDummy = false;
         cu->m_mvBits = m_entropyCoder->getNumberOfWrittenBits();
-        m_entropyCoder->codeCoeff(cu, 0, cu->getDepth(0), bDummy);
+        m_entropyCoder->codeCoeff(cu, 0, cu->getDepth(0), bDummy, depthRange);
         int totalBits = m_entropyCoder->getNumberOfWrittenBits();
         cu->m_coeffBits = totalBits - cu->m_mvBits;
         return totalBits;
diff -r 62c4779fb0bb -r 82c8be473169 source/Lib/TLibEncoder/TEncSearch.h
--- a/source/Lib/TLibEncoder/TEncSearch.h	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.h	Tue Sep 02 20:40:53 2014 +0530
@@ -135,7 +135,7 @@
     uint32_t xModeBitsRemIntra(TComDataCU * cu, uint32_t partOffset, uint32_t depth, uint32_t preds[3], uint64_t & mpms);
     uint32_t xUpdateCandList(uint32_t mode, uint64_t cost, uint32_t fastCandNum, uint32_t* CandModeList, uint64_t* CandCostList);
 
-    void estIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv);
+    void estIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv, uint32_t* depthRange);
 
     void getBestIntraModeChroma(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv);
 
@@ -152,22 +152,22 @@
 
     void xRecurIntraCodingQT(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, TComYuv* fencYuv,
                              TComYuv* predYuv, ShortYuv* resiYuv, uint32_t& distY, bool bCheckFirst,
-                             uint64_t& dRDCost);
+                             uint64_t& dRDCost, uint32_t* depthRange);
     void xSetIntraResultQT(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, TComYuv* reconYuv);
 
     void generateCoeffRecon(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv);
 
     void xEstimateResidualQT(TComDataCU* cu, uint32_t absPartIdx, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, uint32_t depth,
-                             uint64_t &rdCost, uint32_t &outBits, uint32_t &outDist, uint32_t *puiZeroDist);
+                             uint64_t &rdCost, uint32_t &outBits, uint32_t &outDist, uint32_t *puiZeroDist, uint32_t* tuDepthRange);
     void xSetResidualQTData(TComDataCU* cu, uint32_t absPartIdx, ShortYuv* resiYuv, uint32_t depth, bool bSpatial);
 
-    void residualTransformQuantInter(TComDataCU* cu, uint32_t absPartIdx, TComYuv* fencYuv, ShortYuv* resiYuv, uint32_t depth);
+    void residualTransformQuantInter(TComDataCU* cu, uint32_t absPartIdx, TComYuv* fencYuv, ShortYuv* resiYuv, uint32_t depth, uint32_t* depthRange);
 
     // -------------------------------------------------------------------------------------------------------------------
     // compute symbol bits
     // -------------------------------------------------------------------------------------------------------------------
 
-    uint32_t xSymbolBitsInter(TComDataCU* cu);
+    uint32_t xSymbolBitsInter(TComDataCU* cu, uint32_t* depthRange);
     void offsetSubTUCBFs(TComDataCU* cu, TextType ttype, uint32_t trDepth, uint32_t absPartIdx);
 
 protected:
@@ -178,16 +178,16 @@
     // Intra search
     // --------------------------------------------------------------------------------------------
 
-    void xEncSubdivCbfQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx);
+    void xEncSubdivCbfQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t* depthRange);
     void xEncSubdivCbfQTChroma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx,  uint32_t absPartIdxStep, uint32_t width, uint32_t height);
 
     void xEncCoeffQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx);
     void xEncCoeffQTChroma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, TextType ttype);
     void xEncIntraHeaderLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx);
     void xEncIntraHeaderChroma(TComDataCU* cu, uint32_t absPartIdx);
-    uint32_t xGetIntraBitsQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx);
+    uint32_t xGetIntraBitsQTLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t* depthRange);
     uint32_t xGetIntraBitsQTChroma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t absPartIdxStep);
-    uint32_t xGetIntraBitsLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t log2TrSize, coeff_t* coeff);
+    uint32_t xGetIntraBitsLuma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, uint32_t log2TrSize, coeff_t* coeff, uint32_t* depthRange);
     uint32_t xGetIntraBitsChroma(TComDataCU* cu, uint32_t absPartIdx, uint32_t log2TrSizeC, uint32_t chromaId, coeff_t* coeff);
     void xIntraCodingLumaBlk(TComDataCU* cu, uint32_t absPartIdx, uint32_t log2TrSize, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv,
                              int16_t* reconQt, uint32_t reconQtStride, coeff_t* coeff,
@@ -201,7 +201,7 @@
                                    TComYuv* predYuv, ShortYuv* resiYuv, uint32_t& outDist);
 
     void residualTransformQuantIntra(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, TComYuv* fencYuv,
-                                     TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv);
+                                     TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv, uint32_t* depthRange);
     void residualQTIntrachroma(TComDataCU* cu, uint32_t trDepth, uint32_t absPartIdx, TComYuv* fencYuv,
                                TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv);
 
@@ -233,7 +233,7 @@
     // T & Q & Q-1 & T-1
     // -------------------------------------------------------------------------------------------------------------------
 
-    void xEncodeResidualQT(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool bSubdivAndCbf, TextType ttype);
+    void xEncodeResidualQT(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool bSubdivAndCbf, TextType ttype, uint32_t* depthRange);
 };
 }
 
diff -r 62c4779fb0bb -r 82c8be473169 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/encoder/analysis.cpp	Tue Sep 02 20:40:53 2014 +0530
@@ -532,7 +532,10 @@
     outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
     outTempCU->setCUTransquantBypassSubParts(!!m_param->bLossless, 0, depth);
 
-    estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+    uint32_t tuDepthRange[2];
+    outTempCU->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
+
+    estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], tuDepthRange);
 
     estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
 
@@ -546,7 +549,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = m_bEncodeDQP;
-    m_entropyCoder->codeCoeff(outTempCU, 0, depth, bCodeDQP);
+    m_entropyCoder->codeCoeff(outTempCU, 0, depth, bCodeDQP, tuDepthRange);
     m_entropyCoder->store(m_rdEntropyCoders[depth][CI_TEMP_BEST]);
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();
     outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;
@@ -837,9 +840,9 @@
             {
                 if (depth < g_maxCUDepth)
                 {
-                m_entropyCoder->resetBits();
-                m_entropyCoder->codeSplitFlag(outBestCU, 0, depth);
-                outBestCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits
+                    m_entropyCoder->resetBits();
+                    m_entropyCoder->codeSplitFlag(outBestCU, 0, depth);
+                    outBestCU->m_totalBits += m_entropyCoder->getNumberOfWrittenBits(); // split bits
                 }
                 if (m_rdCost.m_psyRd)
                     outBestCU->m_totalPsyCost = m_rdCost.calcPsyRdCost(outBestCU->m_totalDistortion, outBestCU->m_totalBits, outBestCU->m_psyEnergy);
@@ -850,8 +853,8 @@
             // copy original YUV samples in lossless mode
             if (outBestCU->isLosslessCoded(0))
                 fillOrigYUVBuffer(outBestCU, m_origYuv[depth]);
-            }
         }
+    }
 
     // further split
     if (bSubBranch && depth < g_maxCUDepth)
@@ -1814,7 +1817,10 @@
     outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
     outTempCU->setCUTransquantBypassSubParts(!!m_param->bLossless, 0, depth);
 
-    estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+    uint32_t tuDepthRange[2];
+    outTempCU->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
+
+    estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], tuDepthRange);
 
     estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
 
@@ -1833,7 +1839,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = m_bEncodeDQP;
-    m_entropyCoder->codeCoeff(outTempCU, 0, depth, bCodeDQP);
+    m_entropyCoder->codeCoeff(outTempCU, 0, depth, bCodeDQP, tuDepthRange);
     m_entropyCoder->store(m_rdEntropyCoders[depth][CI_TEMP_BEST]);
     outTempCU->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();
     outTempCU->m_coeffBits = outTempCU->m_totalBits - outTempCU->m_mvBits;
@@ -1864,7 +1870,10 @@
 
     m_quant.setQPforQuant(cu);
 
-    xRecurIntraCodingQT(cu, initTrDepth, 0, fencYuv, predYuv, outResiYuv, puDistY, false, puCost);
+    uint32_t tuDepthRange[2];
+    cu->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
+
+    xRecurIntraCodingQT(cu, initTrDepth, 0, fencYuv, predYuv, outResiYuv, puDistY, false, puCost, tuDepthRange);
     xSetIntraResultQT(cu, initTrDepth, 0, outReconYuv);
 
     //=== update PU data ====
@@ -1889,7 +1898,7 @@
 
     // Encode Coefficients
     bool bCodeDQP = m_bEncodeDQP;
-    m_entropyCoder->codeCoeff(cu, 0, depth, bCodeDQP);
+    m_entropyCoder->codeCoeff(cu, 0, depth, bCodeDQP, tuDepthRange);
     m_entropyCoder->store(m_rdEntropyCoders[depth][CI_TEMP_BEST]);
 
     cu->m_totalBits = m_entropyCoder->getNumberOfWrittenBits();
@@ -1960,8 +1969,10 @@
             dststride = m_tmpResiYuv[depth]->m_cwidth;
             primitives.chroma[m_param->internalCsp].sub_ps[sizeIdx](dst, dststride, src1, src2, src1stride, src2stride);
 
+            uint32_t tuDepthRange[2];
+            cu->getQuadtreeTULog2MinSizeInCU(tuDepthRange, 0);
             // Residual encoding
-            residualTransformQuantInter(cu, 0, m_origYuv[0], m_tmpResiYuv[depth], cu->getDepth(0));
+            residualTransformQuantInter(cu, 0, m_origYuv[0], m_tmpResiYuv[depth], cu->getDepth(0), tuDepthRange);
             checkDQP(cu);
 
             if (lcu->getMergeFlag(absPartIdx) && cu->getPartitionSize(0) == SIZE_2Nx2N && !cu->getQtRootCbf(0))
diff -r 62c4779fb0bb -r 82c8be473169 source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/encoder/entropy.cpp	Tue Sep 02 20:40:53 2014 +0530
@@ -552,8 +552,11 @@
     // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
     codePredInfo(cu, absPartIdx);
 
+    uint32_t tuDepthRange[2];
+    cu->getQuadtreeTULog2MinSizeInCU(tuDepthRange, absPartIdx);
+
     // Encode Coefficients, allow codeCoeff() to modify m_bEncodeDQP
-    codeCoeff(cu, absPartIdx, depth, bEncodeDQP);
+    codeCoeff(cu, absPartIdx, depth, bEncodeDQP, tuDepthRange);
 
     // --- write terminating bit ---
     finishCU(cu, absPartIdx, depth);
@@ -593,7 +596,7 @@
 }
 
 void Entropy::encodeTransform(TComDataCU* cu, CoeffCodeState& state, uint32_t offsetLuma, uint32_t offsetChroma, uint32_t absPartIdx,
-                              uint32_t absPartIdxStep, uint32_t depth, uint32_t log2TrSize, uint32_t trIdx, bool& bCodeDQP)
+                              uint32_t absPartIdxStep, uint32_t depth, uint32_t log2TrSize, uint32_t trIdx, bool& bCodeDQP, uint32_t* depthRange)
 {
     const bool subdiv = cu->getTransformIdx(absPartIdx) + cu->getDepth(absPartIdx) > (uint8_t)depth;
     uint32_t hChromaShift = cu->getHorzChromaShift();
@@ -627,7 +630,7 @@
     else if (cu->getPredictionMode(absPartIdx) == MODE_INTER && (cu->getPartitionSize(absPartIdx) != SIZE_2Nx2N) && depth == cu->getDepth(absPartIdx) &&
              (cu->m_slice->m_sps->quadtreeTUMaxDepthInter == 1))
     {
-        if (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx))
+        if (log2TrSize > *depthRange)
         {
             X265_CHECK(subdiv, "subdivision state failure\n");
         }
@@ -636,7 +639,7 @@
             X265_CHECK(!subdiv, "subdivision state failure\n");
         }
     }
-    else if (log2TrSize > cu->m_slice->m_sps->quadtreeTULog2MaxSize)
+    else if (log2TrSize > *(depthRange + 1))
     {
         X265_CHECK(subdiv, "subdivision state failure\n");
     }
@@ -644,13 +647,13 @@
     {
         X265_CHECK(!subdiv, "subdivision state failure\n");
     }
-    else if (log2TrSize == cu->getQuadtreeTULog2MinSizeInCU(absPartIdx))
+    else if (log2TrSize == *depthRange)
     {
         X265_CHECK(!subdiv, "subdivision state failure\n");
     }
     else
     {
-        X265_CHECK(log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx), "transform size failure\n");
+        X265_CHECK(log2TrSize > *depthRange, "transform size failure\n");
         codeTransformSubdivFlag(subdiv, 5 - log2TrSize);
     }
 
@@ -686,22 +689,22 @@
         absPartIdxStep >>= 2;
         const uint32_t partNum = cu->m_pic->getNumPartInCU() >> (depth << 1);
 
-        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP);
+        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);
 
         absPartIdx += partNum;
         offsetLuma += numCoeff;
         offsetChroma += numCoeffC;
-        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP);
+        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);
 
         absPartIdx += partNum;
         offsetLuma += numCoeff;
         offsetChroma += numCoeffC;
-        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP);
+        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);
 
         absPartIdx += partNum;
         offsetLuma += numCoeff;
         offsetChroma += numCoeffC;
-        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP);
+        encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);
     }
     else
     {
@@ -847,7 +850,7 @@
         codeRefFrmIdx(cu, absPartIdx, list);
 }
 
-void Entropy::codeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool& bCodeDQP)
+void Entropy::codeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool& bCodeDQP, uint32_t* depthRange)
 {
     if (!cu->isIntra(absPartIdx))
     {
@@ -862,7 +865,7 @@
     uint32_t chromaOffset = lumaOffset >> (cu->getHorzChromaShift() + cu->getVertChromaShift());
     uint32_t absPartIdxStep = cu->m_pic->getNumPartInCU() >> (depth << 1);
     CoeffCodeState state;
-    encodeTransform(cu, state, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, log2CUSize, 0, bCodeDQP);
+    encodeTransform(cu, state, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, log2CUSize, 0, bCodeDQP, depthRange);
 }
 
 void Entropy::codeSaoOffset(SaoLcuParam* saoLcuParam, uint32_t compIdx)
diff -r 62c4779fb0bb -r 82c8be473169 source/encoder/entropy.h
--- a/source/encoder/entropy.h	Thu Aug 28 13:14:34 2014 +0530
+++ b/source/encoder/entropy.h	Tue Sep 02 20:40:53 2014 +0530
@@ -169,7 +169,7 @@
     void codeQtCbf(TComDataCU* cu, uint32_t absPartIdx, TextType ttype, uint32_t trDepth);
     void codeQtCbfZero(TComDataCU* cu, TextType ttype, uint32_t trDepth);
     void codeQtRootCbfZero(TComDataCU* cu);
-    void codeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool& bCodeDQP);
+    void codeCoeff(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool& bCodeDQP, uint32_t* depthRange);
     void codeCoeffNxN(TComDataCU* cu, coeff_t* coef, uint32_t absPartIdx, uint32_t log2TrSize, TextType ttype);
 
     void codeIntraDirLumaAng(TComDataCU* cu, uint32_t absPartIdx, bool isMultiple);
@@ -230,7 +230,8 @@
         uint32_t bakAbsPartIdxCU;
     };
 
-    void encodeTransform(TComDataCU* cu, CoeffCodeState& state, uint32_t offsetLumaOffset, uint32_t offsetChroma, uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t log2TrSize, uint32_t uiTrIdx, bool& bCodeDQP);
+    void encodeTransform(TComDataCU* cu, CoeffCodeState& state, uint32_t offsetLumaOffset, uint32_t offsetChroma, 
+                         uint32_t absPartIdx, uint32_t absPartIdxStep, uint32_t depth, uint32_t log2TrSize, uint32_t uiTrIdx, bool& bCodeDQP, uint32_t* depthRange);
 
     void copyFrom(Entropy& src);
     void copyContextsFrom(Entropy& src);



More information about the x265-devel mailing list