Index: branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1169)
@@ -1681,4 +1681,51 @@
 Void TAppEncTop::xSetRepFormat( TComVPS& vps )
 {
+
+#if H_3D_DISABLE_CHROMA
+  Bool anyDepth = false; 
+  for ( Int i = 0; i < m_numberOfLayers; i++ )
+  {
+    vps.setVpsRepFormatIdx( i, m_depthFlag[ i ] ? 1 : 0 );
+    anyDepth = anyDepth || m_depthFlag[ i ]; 
+  }  
+
+  vps.setRepFormatIdxPresentFlag( anyDepth ); 
+  vps.setVpsNumRepFormatsMinus1 ( anyDepth ? 1 : 0  ); 
+
+  for ( Int j = 0; j <= vps.getVpsNumRepFormatsMinus1(); j++ )
+  {
+    TComRepFormat* repFormat = new TComRepFormat; 
+
+    repFormat->setBitDepthVpsChromaMinus8   ( g_bitDepthC - 8 ); 
+    repFormat->setBitDepthVpsLumaMinus8     ( g_bitDepthY - 8 );
+    repFormat->setChromaFormatVpsIdc        ( j == 1 ? CHROMA_400 : CHROMA_420 );
+    repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight );
+    repFormat->setPicWidthVpsInLumaSamples  ( m_iSourceWidth  );    
+    repFormat->setChromaAndBitDepthVpsPresentFlag( true );    
+    // ToDo not supported yet. 
+    //repFormat->setSeparateColourPlaneVpsFlag( );
+#if H_MV_FIX_CONF_WINDOW
+    Bool conformanceWindowVpsFlag = ( m_confWinBottom != 0 ) || ( m_confWinRight != 0 ) || ( m_confWinTop != 0 ) || ( m_confWinBottom != 0 ); 
+    repFormat->setConformanceWindowVpsFlag( conformanceWindowVpsFlag );
+    if ( conformanceWindowVpsFlag ) 
+    {   
+      repFormat->setConfWinVpsLeftOffset    ( m_confWinLeft   / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() ) );
+      repFormat->setConfWinVpsRightOffset   ( m_confWinRight  / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() )  );
+      repFormat->setConfWinVpsTopOffset     ( m_confWinTop    / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() )  );
+      repFormat->setConfWinVpsBottomOffset  ( m_confWinBottom / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() ) ); 
+    }
+#else
+    repFormat->setConformanceWindowVpsFlag( true );
+    repFormat->setConfWinVpsLeftOffset    ( m_confWinLeft   / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() ) );
+    repFormat->setConfWinVpsRightOffset   ( m_confWinRight  / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() )  );
+    repFormat->setConfWinVpsTopOffset     ( m_confWinTop    / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() )  );
+    repFormat->setConfWinVpsBottomOffset  ( m_confWinBottom / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() ) ); 
+#endif
+    assert( vps.getRepFormat( j ) == NULL ); 
+    vps.setRepFormat( j , repFormat );
+  }; 
+
+
+#else
   vps.setRepFormatIdxPresentFlag( false ); 
   vps.setVpsNumRepFormatsMinus1 ( 0    ); 
@@ -1709,4 +1756,5 @@
   assert( vps.getRepFormat( 0 ) == NULL ); 
   vps.setRepFormat( 0 , repFormat );
+#endif
 }
 
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1169)
@@ -2446,4 +2446,11 @@
 Void TComDataCU::setCbfSubParts( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth )
 {
+#if H_3D_DISABLE_CHROMA
+  if( this->getSlice()->getIsDepth() )
+  {
+    uiCbfU = 0;
+    uiCbfV = 0;
+  }
+#endif
   UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
   memset( m_puhCbf[0] + uiAbsPartIdx, uiCbfY, sizeof( UChar ) * uiCurrPartNumb );
@@ -2454,4 +2461,12 @@
 Void TComDataCU::setCbfSubParts( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth )
 {
+#if H_3D_DISABLE_CHROMA
+  assert( getSlice() != NULL );
+  if( this->getSlice()->getIsDepth() && g_aucConvertTxtTypeToIdx[eTType] > 0  )
+  {
+    uiCbf = 0;    
+  }
+#endif
+
   UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
   memset( m_puhCbf[g_aucConvertTxtTypeToIdx[eTType]] + uiAbsPartIdx, uiCbf, sizeof( UChar ) * uiCurrPartNumb );
@@ -2468,4 +2483,11 @@
 Void TComDataCU::setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
+#if H_3D_DISABLE_CHROMA
+  assert( getSlice() != NULL );
+  if( this->getSlice()->getIsDepth() && g_aucConvertTxtTypeToIdx[eTType] > 0  )
+  {
+    uiCbf = 0;    
+  }
+#endif
   setSubPart<UChar>( uiCbf, m_puhCbf[g_aucConvertTxtTypeToIdx[eTType]], uiAbsPartIdx, uiDepth, uiPartIdx );
 }
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 1169)
@@ -313,4 +313,7 @@
   TComPic*      getPic                ()                        { return m_pcPic;           }
   TComSlice*    getSlice              ()                        { return m_pcSlice;         }
+#if H_3D_DISABLE_CHROMA
+  Void         setSlice              ( TComSlice* pcSlice)     { m_pcSlice = pcSlice;       }
+#endif
   UInt&         getAddr               ()                        { return m_uiCUAddr;        }
   UInt&         getZorderIdxInCU      ()                        { return m_uiAbsIdxInLCU; }
@@ -433,8 +436,17 @@
   Pel*&         getPCMSampleCr        ()                        { return m_pcIPCMSampleCr;    }
 
+#if H_3D_DISABLE_CHROMA
+  UChar         getCbf    ( UInt uiIdx, TextType eType )                  { assert( getSlice() != NULL ); assert(  g_aucConvertTxtTypeToIdx[eType] == 0 || !getSlice()->getIsDepth() || m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] == 0 );  return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
+  UChar*        getCbf    ( TextType eType )                              { assert( getSlice() != NULL ); assert(  g_aucConvertTxtTypeToIdx[eType] == 0 || !getSlice()->getIsDepth() || m_puhCbf[g_aucConvertTxtTypeToIdx[eType]] );              return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }  
+#else
   UChar         getCbf    ( UInt uiIdx, TextType eType )                  { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
   UChar*        getCbf    ( TextType eType )                              { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }
+#endif
   UChar         getCbf    ( UInt uiIdx, TextType eType, UInt uiTrDepth )  { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); }
+#if H_3D_DISABLE_CHROMA
+  Void          setCbf    ( UInt uiIdx, TextType eType, UChar uh )        { assert( getSlice() != NULL ); m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = ( g_aucConvertTxtTypeToIdx[eType] > 0 && getSlice()->getIsDepth() ) ? 0 : uh ;    }
+#else
   Void          setCbf    ( UInt uiIdx, TextType eType, UChar uh )        { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh;    }
+#endif
   Void          clearCbf  ( UInt uiIdx, TextType eType, UInt uiNumParts );
   UChar         getQtRootCbf          ( UInt uiIdx )                      { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); }
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp	(revision 1169)
@@ -391,4 +391,5 @@
 Bool g_tracePU = false; 
 Bool g_traceTU = false; 
+Bool g_disableNumbering = true; 
 Bool g_disableHLSTrace = false; 
 UInt64 g_stopAtCounter       = 0; 
@@ -633,5 +634,8 @@
       std::cout << "Break point here." << std::endl; 
     }
-    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+    if ( !g_disableNumbering )
+    {  
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+    }
     fprintf( g_hTrace, "%-50s       : %d\n", symbolName, val );     
     fflush ( g_hTrace );
@@ -770,5 +774,5 @@
 
 #if SHARP_DMM_CLEAN_K0042
-    posEnd = racWedgeList.size();
+    posEnd = (Int) racWedgeList.size();
     if (uiOri == 0 || uiOri == 4)
     {
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.h	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.h	(revision 1169)
@@ -257,4 +257,5 @@
  extern Bool   g_traceTU; 
  extern Bool   g_disableHLSTrace;       // USE g_HLSTraceEnable to toggle HLS trace. Not this one!
+ extern Bool   g_disableNumbering;      // Don't print numbers to trace file
  extern UInt64 g_stopAtCounter;         // Counter to set breakpoint. 
  extern Bool   g_traceCopyBack;         // Output samples on copy back  
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 1169)
@@ -1772,6 +1772,11 @@
   Void setChromaFormatIdc (Int i)    { m_chromaFormatIdc = i;          }
 
+#if H_3D_DISABLE_CHROMA
+  static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];      }
+  static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];      }
+#else
   static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];      }
   static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];      }
+#endif
   
   // structure
Index: branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1169)
@@ -67,4 +67,5 @@
 #if H_MV
 #define SONY_MV_V_CONST_C0078            1   // Control disparity vector search range via configuration file
+#define H_MV_FIX_CONF_WINDOW             1   
 #endif
 
@@ -80,5 +81,5 @@
 
 #if H_MV
-#define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
+#define H_MV_ENC_DEC_TRAC                 0  //< CU/PU level tracking
 #endif
 
@@ -326,4 +327,5 @@
 
 #define FIX_TICKET_95                          1   // pps_scaling_list_ref_layer_id parsing
+#define H_3D_DISABLE_CHROMA                    1 
 
 #if H_3D
Index: branches/HTM-13.1-dev0/source/Lib/TLibDecoder/SyntaxElementParser.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1169)
@@ -54,6 +54,12 @@
     return; 
   }
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  if ( !g_disableNumbering )
+  {
+#endif
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+  }
+#endif
+
   if (length < 10)
   {
@@ -75,6 +81,11 @@
     return; 
   }
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  if ( !g_disableNumbering )
+  {
+#endif
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+  }
+#endif
   fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue ); 
   fflush ( g_hTrace );
@@ -89,6 +100,12 @@
     return; 
   }
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  if ( !g_disableNumbering )
+  {
+#endif
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+  }
+#endif
+
   fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, rValue ); 
   fflush ( g_hTrace );
@@ -103,6 +120,11 @@
     return; 
   }
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  if ( !g_disableNumbering )
+  {
+#endif
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+  }
+#endif
   fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, rValue ); 
   fflush ( g_hTrace );
Index: branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1169)
@@ -777,5 +777,7 @@
     assert(uiCode <= 3);
     // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
+#if !H_3D_DISABLE_CHROMA
     assert (uiCode == 1);
+#endif
     if( uiCode == 3 )
     {
@@ -1477,5 +1479,5 @@
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     {
-        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
+      READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     }
   }
@@ -2119,5 +2121,11 @@
     }
     // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
+
+#if H_3D_DISABLE_CHROMA
+    assert (sps->getChromaFormatIdc() == 1 || rpcSlice->getIsDepth() );
+    assert (sps->getChromaFormatIdc() == 0 || !rpcSlice->getIsDepth() );
+#else
     assert (sps->getChromaFormatIdc() == 1 );
+#endif
     // if( separate_colour_plane_flag  ==  1 )
     //   colour_plane_id                                      u(2)
@@ -2420,5 +2428,17 @@
     {
       READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
+#if H_3D_DISABLE_CHROMA
+      if( !rpcSlice->getIsDepth() )
+      {
       READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
+    }
+      else
+      {
+        rpcSlice->setSaoEnabledFlagChroma( false );
+      }
+      
+#else
+      READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
+#endif
     }
 
@@ -3165,10 +3185,14 @@
 {
   wpScalingParam  *wp;
+#if H_3D_DISABLE_CHROMA
+  Bool            bChroma     = !pcSlice->getIsDepth();
+#else
   Bool            bChroma     = true; // color always present in HEVC ?
+#endif
   SliceType       eSliceType  = pcSlice->getSliceType();
   Int             iNbRef       = (eSliceType == B_SLICE ) ? (2) : (1);
   UInt            uiLog2WeightDenomLuma, uiLog2WeightDenomChroma;
   UInt            uiTotalSignalledWeightFlags = 0;
-  
+
   Int iDeltaDenom;
   // decode delta_luma_log2_weight_denom :
@@ -3182,4 +3206,11 @@
     uiLog2WeightDenomChroma = (UInt)(iDeltaDenom + uiLog2WeightDenomLuma);
   }
+  else
+#if H_3D_DISABLE_CHROMA
+  { 
+    uiLog2WeightDenomChroma = 0; 
+  }
+#endif
+
 
   for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) 
Index: branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1169)
@@ -176,5 +176,9 @@
     decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
 #if H_3D_DIM_SDC
+#if H_3D_DISABLE_CHROMA
+    if(!pcCU->getSDCFlag(uiAbsPartIdx) && !pcCU->getSlice()->getIsDepth() )
+#else
     if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
 #endif
     decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
@@ -541,4 +545,16 @@
 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int quadtreeTULog2MinSizeInCU)
 {
+
+#if H_MV_ENC_DEC_TRAC
+  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
+  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
+  
+  DTRACE_TU_S("=========== transform_tree ===========\n")
+  DTRACE_TU("x0", uiLPelX)
+  DTRACE_TU("x1", uiTPelY)
+  DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth)
+  DTRACE_TU("trafoDepth"  , uiDepth)
+#endif
+
   UInt uiSubdiv;
   const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
@@ -593,4 +609,7 @@
     if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
     {
+#if H_3D_DISABLE_CHROMA
+      if (!pcCU->getSlice()->getIsDepth() )      
+      {
       if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
       {
@@ -601,4 +620,26 @@
         m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
       }
+    }
+    else
+    {
+        if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
+        {
+          pcCU->setCbfSubParts( 0, TEXT_CHROMA_U, uiAbsPartIdx, uiTrDepth - 1 );
+        }
+        if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
+        {
+          pcCU->setCbfSubParts( 0, TEXT_CHROMA_V, uiAbsPartIdx, uiTrDepth - 1 );
+        }
+      }
+#else
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
+      {
+        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
+      }
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
+      {
+        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
+      }
+#endif
     }
     else
@@ -762,6 +803,14 @@
     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
+#if H_3D_DISABLE_CHROMA
+    if (!pcCU->getSlice()->getIsDepth() )
+    {
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+    }
+#else
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+#endif
   }
 
Index: branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1169)
@@ -501,4 +501,9 @@
     }
 
+
+#if H_3D_DISABLE_CHROMA
+    if( !pcCU->getSlice()->getIsDepth() )
+    {    
+#endif
     piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
@@ -532,4 +537,8 @@
       piPCMSample += uiWidth;
     }
+#if H_3D_DISABLE_CHROMA
+    }
+#endif
+
 
     m_pcTDecBinIf->start();
@@ -1366,4 +1375,6 @@
   DTRACE_CABAC_V( uiLog2TransformBlockSize )
   DTRACE_CABAC_T( "\n" )
+#else
+  DTRACE_TU("split_transform_flag", ruiSubdivFlag )
 #endif
 }
@@ -1444,4 +1455,17 @@
   DTRACE_CABAC_V( uiAbsPartIdx )
   DTRACE_CABAC_T( "\n" )
+#else
+  if ( eType == TEXT_CHROMA_U )
+  {
+    DTRACE_TU("cbf_cb", uiSymbol )
+  }
+  else if ( eType == TEXT_CHROMA_V )
+  {
+    DTRACE_TU("cbf_cr", uiSymbol )
+  }
+  else
+  {
+    DTRACE_TU("cbf_luma", uiSymbol )
+  }
 #endif
   
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1169)
@@ -49,5 +49,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     if( length<10 )
     {
@@ -66,5 +74,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     fprintf( g_hTrace, "%-50s ue(v) : %d\n", pSymbolName, value ); 
   }
@@ -76,5 +92,13 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
+
     fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, value ); 
   }
@@ -86,5 +110,12 @@
   if( g_HLSTraceEnable )
   {
+#if H_MV_ENC_DEC_TRAC
+    if ( !g_disableNumbering )
+    {
+#endif
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+#if H_MV_ENC_DEC_TRAC
+    }
+#endif
     fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, value ); 
   }
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1169)
@@ -678,5 +678,7 @@
 #endif
   WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
+#if !H_3D_DISABLE_CHROMA
   assert(pcSPS->getChromaFormatIdc () == 1);
+#endif
   // in the first version chroma_format_idc can only be equal to 1 (4:2:0)
   if( pcSPS->getChromaFormatIdc () == 3 )
@@ -1376,12 +1378,12 @@
   if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
   {  
-  WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
-
-  if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
-  {
-    WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
-  }
-  WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
-  WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
+    WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );  
+
+    if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
+    {
+      WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
+    }
+    WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
+    WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
   }
   else
@@ -1732,5 +1734,10 @@
 
     // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
+#if H_3D_DISABLE_CHROMA
+    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 || pcSlice->getIsDepth() );
+    assert (pcSlice->getSPS()->getChromaFormatIdc() == 0 || !pcSlice->getIsDepth() );
+#else
     assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 );
+#endif
     // if( separate_colour_plane_flag  ==  1 )
     //   colour_plane_id                                      u(2)
@@ -1911,5 +1918,12 @@
       {
          WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" );
+#if H_3D_DISABLE_CHROMA
+         if ( !pcSlice->getIsDepth() )
+         {
          WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
+      }
+#else
+         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
+#endif
       }
     }
@@ -2564,5 +2578,9 @@
 {
   wpScalingParam  *wp;
+#if  H_3D_DISABLE_CHROMA
+  Bool            bChroma     = !pcSlice->getIsDepth(); // color always present in HEVC ?
+#else
   Bool            bChroma     = true; // color always present in HEVC ?
+#endif
   Int             iNbRef       = (pcSlice->getSliceType() == B_SLICE ) ? (2) : (1);
   Bool            bDenomCoded  = false;
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1169)
@@ -275,4 +275,8 @@
   m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
 
+#if H_3D_DISABLE_CHROMA
+  m_ppcWeightedTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
+#endif
+
 #if KWU_RC_MADPRED_E0227
   m_LCUPredictionSAD = 0;
@@ -1249,4 +1253,7 @@
       TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];
 
+#if H_3D_DISABLE_CHROMA
+      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice()); 
+#endif
       for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
       {
@@ -2792,5 +2799,9 @@
   
 #if H_3D_DIM_SDC
+#if 0 // H_3D_DISABLE_CHROMA
+  if( !rpcTempCU->getSDCFlag( 0 ) && !rpcTempCU->getSlice()->getIsDepth() )
+#else
   if( !rpcTempCU->getSDCFlag( 0 ) )
+#endif
 #endif
   m_pcPredSearch  ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC );
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1169)
@@ -304,4 +304,16 @@
 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )
 {
+
+#if H_MV_ENC_DEC_TRAC
+  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
+  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
+
+  DTRACE_TU_S("=========== transform_tree ===========\n")
+  DTRACE_TU("x0", uiLPelX)
+  DTRACE_TU("x1", uiTPelY)
+  DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth)
+  DTRACE_TU("trafoDepth"  , uiDepth)
+#endif
+
   const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
   const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
@@ -366,4 +378,28 @@
   if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
   {
+#if H_3D_DISABLE_CHROMA
+    if (!pcCU->getSlice()->getIsDepth() )
+    {
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
+      {
+        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr );
+      }
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
+      {
+        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
+      }
+    }
+    else
+    {
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
+      {
+        assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == 0 );
+      }
+      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
+      {
+        assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == 0  );
+      }
+    }
+#else
     if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     {
@@ -374,4 +410,5 @@
       m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
     }
+#endif
   }
   else if( uiLog2TrafoSize == 2 )
@@ -506,5 +543,9 @@
     encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
 #if H_3D_DIM_SDC
+#if H_3D_DISABLE_CHROMA
+    if(!pcCU->getSDCFlag(uiAbsPartIdx) && !pcCU->getSlice()->getIsDepth() )
+#else
     if(!pcCU->getSDCFlag(uiAbsPartIdx))
+#endif
 #endif
     encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
@@ -685,7 +726,16 @@
     assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
+#if H_3D_DISABLE_CHROMA
+    if (!pcCU->getSlice()->getIsDepth() )
+    {
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
+      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
+    }
+#else
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-  }
+#endif
+  }
+
 
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1169)
@@ -1950,4 +1950,11 @@
               m_pcSAO->PCMLFDisableProcess(pcPic);
 
+#if H_3D_DISABLE_CHROMA
+            if (pcSlice->getIsDepth())
+            {
+              sliceEnabled[SAO_Cb] = false; 
+              sliceEnabled[SAO_Cr] = false; 
+            }
+#endif
             //assign SAO slice header
             for(Int s=0; s< uiNumSlices; s++)
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1169)
@@ -1095,5 +1095,8 @@
   DTRACE_CABAC_V( uiCtx )
   DTRACE_CABAC_T( "\n" )
-#endif
+#else
+  DTRACE_TU("split_transform_flag", uiSymbol )
+#endif
+
 }
 
@@ -1426,4 +1429,17 @@
   DTRACE_CABAC_V( uiAbsPartIdx )
   DTRACE_CABAC_T( "\n" )
+#else
+  if ( eType == TEXT_CHROMA_U )
+  {
+    DTRACE_TU("cbf_cb", uiCbf )
+  }
+  else if ( eType == TEXT_CHROMA_V )
+  {
+    DTRACE_TU("cbf_cr", uiCbf )
+  }
+  else
+  {
+    DTRACE_TU("cbf_luma", uiCbf )
+  }
 #endif
 }
@@ -1501,4 +1517,8 @@
     }
 
+#if H_3D_DISABLE_CHROMA
+    if( !pcCU->getSlice()->getIsDepth() )
+    {    
+#endif
     piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
@@ -1532,4 +1552,7 @@
       piPCMSample += uiWidth;
     }
+#if H_3D_DISABLE_CHROMA
+    }
+#endif
     m_pcBinIf->resetBac();
   }
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1169)
@@ -7335,5 +7335,9 @@
     const UInt uiQTTempAccessLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
 
+#if 0 //H_3D_DISABLE_CHROMA
+    Bool  bCodeChroma   = !pcCU->getSlice()->getIsDepth();
+#else
     Bool  bCodeChroma   = true;
+#endif
     UInt  uiTrModeC     = uiTrMode;
     UInt  uiLog2TrSizeC = uiLog2TrSize-1;
Index: branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1167)
+++ branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1169)
@@ -766,5 +766,5 @@
     }
 #endif
-  }
+  }  
   m_cSPS.setSpsExtensionPresentFlag       ( true ); 
   m_cSPS.setSpsMultilayerExtensionFlag    ( true ); 
@@ -779,4 +779,7 @@
   m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
   m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
+#if H_3D_DISABLE_CHROMA
+  m_cSPS.setChromaFormatIdc( getIsDepth() ? CHROMA_400 : CHROMA_420 ); 
+#endif
 
   Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
