Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_2view+depth_AllIntra.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_2view+depth_AllIntra.cfg	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_2view+depth_AllIntra.cfg	(revision 539)
@@ -148,4 +148,6 @@
 SDC                                : 1
 DLT                                : 1
+QTL                                : 1
+PC                                 : 1
 
 #========== view synthesis optimization (VSO) ==========
Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_3view+depth_AllIntra.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_3view+depth_AllIntra.cfg	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/NonCTC/baseCfg_3view+depth_AllIntra.cfg	(revision 539)
@@ -155,4 +155,6 @@
 SDC                                : 1
 DLT                                : 1
+QTL                                : 1
+PC                                 : 1
 
 #========== view synthesis optimization (VSO) ==========
Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_2view+depth.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_2view+depth.cfg	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_2view+depth.cfg	(revision 539)
@@ -207,4 +207,6 @@
 SDC                                : 1
 DLT                                : 1
+QTL                                : 1
+PC                                 : 1
 
 #========== view synthesis optimization (VSO) ==========
Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view+depth.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view+depth.cfg	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/baseCfg_3view+depth.cfg	(revision 539)
@@ -239,4 +239,6 @@
 SDC                                : 1
 DLT                                : 1
+QTL                                : 1
+PC                                 : 1
 
 #========== view synthesis optimization (VSO) ==========
Index: /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/fullCfg.cfg
===================================================================
--- /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/fullCfg.cfg	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/cfg/3D-HEVC/fullCfg.cfg	(revision 539)
@@ -243,4 +243,6 @@
 SDC                                : 1
 DLT                                : 1
+QTL                                : 1
+PC                                 : 1
 
 #========== view synthesis optimization (VSO) ==========
Index: /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 539)
@@ -703,4 +703,8 @@
 
 #endif //HHI_VSO
+#if H_3D_QTLPC
+  ("QTL",                             m_bUseQTL                 , true          , "Use depth Quadtree Limitation" )
+  ("PC",                              m_bUsePC                  , true          , "Use Predictive Coding with QTL" )
+#endif
 #if H_3D_IV_MERGE
   ("IvMvPred",                        m_ivMvPredFlag,           true            , "inter view motion prediction " )  
@@ -2261,4 +2265,8 @@
   printf("WVSO:%d ", m_bUseWVSO );  
 #endif
+#if H_3D_QTLPC
+  printf("QTL:%d ", m_bUseQTL);
+  printf("PC:%d " , m_bUsePC );
+#endif
 #if H_3D_IV_MERGE
   printf("IvMvPred:%d ", m_ivMvPredFlag );
Index: /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h	(revision 539)
@@ -428,4 +428,8 @@
   Bool      m_useDLT;                                        ///< flag for using DLT
 #endif
+#if H_3D_QTLPC
+  Bool      m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
+  Bool      m_bUsePC;                                         ///< flag for using Predictive Coding with QTL
+#endif
 #endif
   // internal member functions
Index: /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp	(revision 539)
@@ -185,4 +185,8 @@
     m_cTEncTop.setUseSDC                       ( isDepth ? m_useSDC               : false );
     m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT               : false );
+#endif
+#if H_3D_QTLPC
+    m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL               : false );
+    m_cTEncTop.setUsePC                        ( isDepth ? m_bUsePC                : false );
 #endif
 #endif // H_3D
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp	(revision 539)
@@ -77,4 +77,7 @@
   m_apcPicYuv[0]      = NULL;
   m_apcPicYuv[1]      = NULL;
+#if H_3D_QTLPC
+  m_bReduceBitsQTL    = 0;
+#endif
 #if H_3D_NBDV
   m_iNumDdvCandPics   = 0;
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.h	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.h	(revision 539)
@@ -96,4 +96,7 @@
 #endif
 #endif
+#if H_3D_QTLPC
+  Bool                  m_bReduceBitsQTL;
+#endif
 #if H_3D_NBDV
   UInt        m_uiRapRefIdx;
@@ -130,4 +133,10 @@
 #endif
 #endif
+
+#if H_3D_QTLPC
+  Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
+  Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
+#endif
+
   Bool          getUsedByCurr()             { return m_bUsedByCurr; }
   Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp	(revision 539)
@@ -1880,4 +1880,8 @@
 , m_bCamParInSliceHeader      (false)
 #endif
+#if H_3D_QTLPC
+, m_bUseQTL                   (false)
+, m_bUsePC                    (false)
+#endif
 {
   for ( Int i = 0; i < MAX_TLAYER; i++ )
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h	(revision 539)
@@ -972,4 +972,9 @@
   UInt        m_uiPCMLog2MinSize;
   Bool        m_useAMP;
+
+#if H_3D_QTLPC
+  Bool        m_bUseQTL;
+  Bool        m_bUsePC;
+#endif
 
   // Parameter
@@ -1170,4 +1175,12 @@
   Int  getMinHorizontalCtuOffsetPlus1 ( Int i )            { return m_minHorizontalCtuOffsetPlus1 [ i ];}
 #endif
+
+#if H_3D_QTLPC
+  Void setUseQTL( Bool b ) { m_bUseQTL = b;    }
+  Bool getUseQTL()         { return m_bUseQTL; }
+  Void setUsePC ( Bool b ) { m_bUsePC  = b;    }
+  Bool getUsePC ()         { return m_bUsePC;  }
+#endif
+
 #if H_3D
   Void initCamParaSPS      (  UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComWedgelet.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 539)
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h	(revision 539)
@@ -75,4 +75,7 @@
 
 #if H_3D
+#define H_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
+                                              // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
+
 #define H_3D_PDM_CAM_PARAS                0 ///< PDM related parts of camera parameters, should be removed if not used anymore.
 #define H_3D_VSO                          1   // VSO, View synthesis optimization, includes: 
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 539)
@@ -734,5 +734,15 @@
         }  
       }  
-    }  
+    }
+
+#if H_3D_QTLPC
+    if( depthFlag )
+    {
+      READ_FLAG( uiCode, "use_qtl_flag" );
+      pcSPS->setUseQTL( uiCode );
+      READ_FLAG( uiCode, "use_pc_flag" );
+      pcSPS->setUsePC( uiCode );
+    }
+#endif
 
     ////   sps_extension_vui_parameters( ) END
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 539)
@@ -821,12 +821,40 @@
     return;
   }
-  
+
   UInt uiSymbol;
-  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
+
+#if H_3D_QTLPC
+  Bool bParseSplitFlag    = true;
+
+  TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
+  TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
+  Bool bDepthMapDetect    = (pcTexture != NULL);
+  Bool bIntraSliceDetect  = (pcCU->getSlice()->getSliceType() == I_SLICE);
+
+  Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
+
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
+  {
+    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
+    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
+    bParseSplitFlag         = (pcTextureCU->getDepth(uiAbsPartIdx) > uiDepth);
+  }
+
+  if(bParseSplitFlag)
+  {
+#endif
+    m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
 #if H_MV_ENC_DEC_TRAC
-  DTRACE_CU("split_cu_flag", uiSymbol); 
+    DTRACE_CU("split_cu_flag", uiSymbol); 
 #else
-  DTRACE_CABAC_VL( g_nSymbolCounter++ )
-  DTRACE_CABAC_T( "\tSplitFlag\n" )
+    DTRACE_CABAC_VL( g_nSymbolCounter++ )
+    DTRACE_CABAC_T( "\tSplitFlag\n" )
+#endif
+#if H_3D_QTLPC
+  }
+  else
+  {
+    uiSymbol = 0;
+  }
 #endif
   pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx );
@@ -845,16 +873,45 @@
   UInt uiSymbol, uiMode = 0;
   PartSize eMode;
+
+#if H_3D_QTLPC
+  Bool bParsePartSize    = true;
+  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
+  Bool bDepthMapDetect   = (pcTexture != NULL);
+  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
+
+  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
+
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
+  {
+    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
+    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
+    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN)
+    {
+      bParsePartSize = false;
+      eMode          = SIZE_2Nx2N;
+    }
+  }
+#endif
+
   
   if ( pcCU->isIntra( uiAbsPartIdx ) )
   {
-    uiSymbol = 1;
-    if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
-    {
-      m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
+#if H_3D_QTLPC
+    if(bParsePartSize)
+    {
+#endif
+     uiSymbol = 1;
+      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
+      {
+        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
 #if H_MV_ENC_DEC_TRAC          
-      DTRACE_CU("part_mode", uiSymbol)
+        DTRACE_CU("part_mode", uiSymbol)
 #endif        
-    }
-    eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
+      }
+      eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
+#if H_3D_QTLPC
+    }
+#endif
     UInt uiTrLevel = 0;    
     UInt uiWidthInBit  = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2;
@@ -872,43 +929,50 @@
   else
   {
-    UInt uiMaxNumBits = 2;
-    if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
-    {
-      uiMaxNumBits ++;
-    }
-    for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
-    {
-      m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
-      if ( uiSymbol )
-      {
-        break;
-      }
-      uiMode++;
-    }
-    eMode = (PartSize) uiMode;
-    if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
-    {
-      if (eMode == SIZE_2NxN)
-      {
-        m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
-        if (uiSymbol == 0)
+#if H_3D_QTLPC
+    if(bParsePartSize)
+    {
+#endif
+      UInt uiMaxNumBits = 2;
+      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
+      {
+        uiMaxNumBits ++;
+      }
+      for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
+      {
+        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
+        if ( uiSymbol )
         {
-          m_pcTDecBinIf->decodeBinEP(uiSymbol);
-          eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
+          break;
         }
-      }
-      else if (eMode == SIZE_Nx2N)
-      {
-        m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
-        if (uiSymbol == 0)
+        uiMode++;
+      }
+      eMode = (PartSize) uiMode;
+      if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
+      {
+        if (eMode == SIZE_2NxN)
         {
-          m_pcTDecBinIf->decodeBinEP(uiSymbol);
-          eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
+          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
+          if (uiSymbol == 0)
+          {
+            m_pcTDecBinIf->decodeBinEP(uiSymbol);
+            eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
+          }
         }
-      }
-    }
+        else if (eMode == SIZE_Nx2N)
+        {
+          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
+          if (uiSymbol == 0)
+          {
+            m_pcTDecBinIf->decodeBinEP(uiSymbol);
+            eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
+          }
+        }
+      }
 #if H_MV_ENC_DEC_TRAC          
-    DTRACE_CU("part_mode", eMode )
-#endif        
+      DTRACE_CU("part_mode", eMode )
+#endif
+#if H_3D_QTLPC
+    }
+#endif
   }
   pcCU->setPartSizeSubParts( eMode, uiAbsPartIdx, uiDepth );
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 539)
@@ -550,5 +550,14 @@
       }  
     }  
-  }  
+  } 
+
+#if H_3D_QTLPC
+  if( depthFlag )
+  {
+    WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");
+    WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
+  }
+#endif
+
   ////   sps_extension_vui_parameters( ) END
   WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" ); 
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h	(revision 539)
@@ -401,4 +401,10 @@
   Bool      m_useDLT;
 #endif
+
+#if H_3D_QTLPC
+  Bool      m_bUseQTL;
+  Bool      m_bUsePC;
+#endif
+
 #endif
 public:
@@ -946,4 +952,12 @@
   Void      setUseDLT                       ( Bool b) { m_useDLT = b;    }
 #endif
+
+#if H_3D_QTLPC
+  Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
+  Bool      getUseQTL                       ()         { return m_bUseQTL; }
+  Void      setUsePC                        ( Bool b ) { m_bUsePC  = b;    }
+  Bool      getUsePC                        ()         { return m_bUsePC;  }
+#endif
+
 #endif // H_3D
 };
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp	(revision 539)
@@ -388,4 +388,17 @@
   TComPic* pcPic = rpcBestCU->getPic();
 
+#if H_3D_QTLPC
+  TComSPS *sps            = pcPic->getSlice(0)->getSPS();
+  TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
+
+  Bool  depthMapDetect    = (pcTexture != NULL);
+  Bool  bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType() == I_SLICE);
+
+  Bool rapPic             = (rpcBestCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || rpcBestCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || rpcBestCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
+
+  Bool bTry2NxN           = true;
+  Bool bTryNx2N           = true;
+#endif
+
   // get Original YUV data from picture
   m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
@@ -481,4 +494,28 @@
 
       rpcTempCU->initEstData( uiDepth, iQP );
+
+#if H_3D_QTLPC
+      //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
+
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
+      {
+        TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
+        UInt uiCUIdx            = rpcBestCU->getZorderIdxInCU();
+        assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitionned than the texture.
+        if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split.
+        {
+          bTrySplit = true;
+          bTryNx2N  = true;
+          bTry2NxN  = true;
+        }
+        else
+        {
+          bTrySplit = false;
+          bTryNx2N  = false;
+          bTry2NxN  = false;
+        }
+      }
+#endif
+
 #if H_3D_NBDV
       DisInfo DvInfo; 
@@ -575,15 +612,26 @@
       }
 
-      if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
-      {
-        if(iQP == iBaseQP)
+#if H_3D_QTLPC
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
+      {
+        bTrySplitDQP = bTrySplit;
+      }
+      else
+      {
+#endif
+        if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
+        {
+          if(iQP == iBaseQP)
+          {
+            bTrySplitDQP = bTrySplit;
+          }
+        }
+        else
         {
           bTrySplitDQP = bTrySplit;
         }
-      }
-      else
-      {
-        bTrySplitDQP = bTrySplit;
-      }
+#if H_3D_QTLPC
+      }
+#endif
       if (isAddLowestQP && (iQP == lowestQP))
       {
@@ -625,5 +673,9 @@
             if(!( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) ))
             {
-              if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu)
+              if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu
+#if H_3D_QTLPC
+                && bTrySplit
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN   );
@@ -634,5 +686,9 @@
 
           // 2NxN, Nx2N
-          if(doNotBlockPu)
+          if(doNotBlockPu
+#if H_3D_QTLPC
+            && bTryNx2N
+#endif
+            )
           {
             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N  );
@@ -643,5 +699,9 @@
             }
           }
-          if(doNotBlockPu)
+          if(doNotBlockPu
+#if H_3D_QTLPC
+            && bTry2NxN
+#endif
+            )
           {
             xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN  );
@@ -671,5 +731,9 @@
             if ( bTestAMP_Hor )
             {
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTry2NxN
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
@@ -680,5 +744,9 @@
                 }
               }
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTry2NxN
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
@@ -693,5 +761,9 @@
             else if ( bTestMergeAMP_Hor ) 
             {
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTry2NxN
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true );
@@ -702,5 +774,9 @@
                 }
               }
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTry2NxN
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true );
@@ -717,5 +793,9 @@
             if ( bTestAMP_Ver )
             {
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTryNx2N
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
@@ -726,5 +806,9 @@
                 }
               }
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTryNx2N
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
@@ -735,5 +819,9 @@
             else if ( bTestMergeAMP_Ver )
             {
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTryNx2N
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true );
@@ -744,5 +832,9 @@
                 }
               }
-              if(doNotBlockPu)
+              if(doNotBlockPu
+#if H_3D_QTLPC
+                && bTryNx2N
+#endif
+                )
               {
                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true );
@@ -753,13 +845,24 @@
 
 #else
-            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
-            rpcTempCU->initEstData( uiDepth, iQP );
-            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
-            rpcTempCU->initEstData( uiDepth, iQP );
-            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
-            rpcTempCU->initEstData( uiDepth, iQP );
-
-            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
-            rpcTempCU->initEstData( uiDepth, iQP );
+#if H_3D_QTLPC
+            if (bTry2NxN)
+            {
+#endif
+              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
+              rpcTempCU->initEstData( uiDepth, iQP );
+              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
+              rpcTempCU->initEstData( uiDepth, iQP );
+#if H_3D_QTLPC
+            }
+            if (bTryNx2N)
+            {
+#endif
+              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
+              rpcTempCU->initEstData( uiDepth, iQP );
+              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
+              rpcTempCU->initEstData( uiDepth, iQP );
+#if H_3D_QTLPC
+            }
+#endif
 
 #endif
@@ -789,9 +892,16 @@
             if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
             {
-              if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
+#if H_3D_QTLPC //Try IntraNxN
+              if(bTrySplit)
               {
-                xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
-                rpcTempCU->initEstData( uiDepth, iQP );
+#endif
+                if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
+                {
+                  xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
+                  rpcTempCU->initEstData( uiDepth, iQP );
+                }
+#if H_3D_QTLPC
               }
+#endif
             }
           }
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 539)
@@ -730,4 +730,26 @@
 {
   PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
+
+#if H_3D_QTLPC
+  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
+  Bool bDepthMapDetect   = (pcTexture != NULL);
+  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
+ 
+  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
+
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
+  {
+    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
+    UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
+    assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
+    if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN)
+    {
+      assert( eSize == SIZE_2Nx2N );
+      return;
+    }
+  }
+#endif
+
   if ( pcCU->isIntra( uiAbsPartIdx ) )
   {
@@ -989,4 +1011,30 @@
   
   assert( uiCtx < 3 );
+
+#if H_3D_QTLPC
+  Bool bCodeSplitFlag    = true;
+
+  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
+  Bool bDepthMapDetect   = (pcTexture != NULL);
+  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
+
+  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
+
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC())
+  {
+    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
+    UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
+    assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
+    bCodeSplitFlag          = (pcTextureCU->getDepth(uiCUIdx) > uiDepth);
+  }
+
+  if(!bCodeSplitFlag)
+  {
+    assert(uiCurrSplitFlag == 0);
+    return;
+  }
+#endif
+
   m_pcBinIf->encodeBin( uiCurrSplitFlag, m_cCUSplitFlagSCModel.get( 0, 0, uiCtx ) );
 #if !H_MV_ENC_DEC_TRAC
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 539)
@@ -1614,4 +1614,8 @@
     }
 
+#if H_3D_QTLPC
+    rpcPic->setReduceBitsFlag(true);
+#endif
+
     TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );    
     if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) )
@@ -1723,4 +1727,7 @@
       }
     }
+#if H_3D_QTLPC
+    rpcPic->setReduceBitsFlag(false);
+#endif
   }
   if( depSliceSegmentsEnabled )
Index: /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp	(revision 538)
+++ /branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp	(revision 539)
@@ -588,4 +588,9 @@
   m_cSPS.setUseAMP ( m_useAMP );
 
+#if H_3D_QTLPC
+  m_cSPS.setUseQTL( m_bUseQTL );
+  m_cSPS.setUsePC ( m_bUsePC  );
+#endif
+
   for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )
   {
