Index: branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 168)
+++ branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 177)
@@ -476,4 +476,8 @@
 #if HHI_MPI
   ("MVI", m_bUseMVI, false, "use motion vector inheritance for depth map coding")
+#endif
+#if RWTH_SDC_DLT_B0036
+  ("DLT", m_bUseDLT, true, "Enables Depth Lookup Table")
+  ("SDC", m_bUseSDC, true, "Enabled Simplified Depth Coding")
 #endif
   ;
@@ -1746,4 +1750,8 @@
   printf("MVI:%d ", m_bUseMVI ? 1 : 0 );
 #endif
+#if RWTH_SDC_DLT_B0036
+  printf("SDC:%d ", m_bUseSDC ? 1 : 0 );
+  printf("DLT:%d ", m_bUseDLT ? 1 : 0 );
+#endif
 #if LGE_WVSO_A0119
   if ( m_bUseWVSO )
Index: branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.h	(revision 168)
+++ branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncCfg.h	(revision 177)
@@ -269,4 +269,8 @@
   Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
 #endif
+#if RWTH_SDC_DLT_B0036
+  Bool      m_bUseDLT;
+  Bool      m_bUseSDC;
+#endif
 
   Int       m_useScalingListId;                               ///< using quantization matrix
Index: branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.cpp	(revision 168)
+++ branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.cpp	(revision 177)
@@ -373,4 +373,8 @@
     m_acTEncTopList[iViewIdx]->setUseMVI( false );
 #endif
+#if RWTH_SDC_DLT_B0036
+    m_acTEncTopList[iViewIdx]->setUseDLT                      ( false );
+    m_acTEncTopList[iViewIdx]->setUseSDC                      ( false );
+#endif
   }
   if( m_bUsingDepthMaps )
@@ -655,4 +659,8 @@
      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
 #endif
+#if RWTH_SDC_DLT_B0036
+      m_acTEncDepthTopList[iViewIdx]->setUseDLT                   ( m_bUseDLT );
+      m_acTEncDepthTopList[iViewIdx]->setUseSDC                   ( m_bUseSDC );
+#endif
     }
   }
@@ -873,4 +881,9 @@
     eos.push_back( false );
     depthEos.push_back( false );
+    
+#if RWTH_SDC_DLT_B0036
+    if( m_bUsingDepthMaps && m_bUseDLT )
+      xAnalyzeInputBaseDepth(iViewIdx, m_iIntraPeriod);
+#endif
   }
 
@@ -1421,4 +1434,80 @@
   return pcPic;
 };
+  
+#if RWTH_SDC_DLT_B0036
+Void TAppEncTop::xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames)
+{
+  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
+  // allocate original YUV buffer
+  pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
+  
+  TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
+  
+  UInt uiMaxDepthValue = g_uiIBDI_MAX;
+  
+  Bool abValidDepths[uiMaxDepthValue+1];
+  
+  depthVideoFile->open( m_pchDepthInputFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth );  // read  mode
+  
+  // initialize boolean array
+  for(Int p=0; p<=uiMaxDepthValue; p++)
+    abValidDepths[p] = false;
+  
+  Int iHeight   = pcDepthPicYuvOrg->getHeight();
+  Int iWidth    = pcDepthPicYuvOrg->getWidth();
+  Int iStride   = pcDepthPicYuvOrg->getStride();
+  
+  Pel* pInDM    = pcDepthPicYuvOrg->getLumaAddr();
+  
+  for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
+  {
+    depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad, false );
+    
+    // check all pixel values
+    for (Int i=0; i<iHeight; i++)
+    {
+      Int rowOffset = i*iStride;
+      
+      for (Int j=0; j<iWidth; j++)
+      {
+        Pel depthValue = pInDM[rowOffset+j];
+        abValidDepths[depthValue] = true;
+      }
+    }
+  }
+  
+  depthVideoFile->close();
+  
+  pcDepthPicYuvOrg->destroy();
+  delete pcDepthPicYuvOrg;
+  
+  // convert boolean array to idx2Depth LUT
+  UInt* auiIdx2DepthValue = (UInt*) calloc(uiMaxDepthValue, sizeof(UInt));
+  UInt uiNumDepthValues = 0;
+  for(UInt p=0; p<=uiMaxDepthValue; p++)
+  {
+    if( abValidDepths[p] == true)
+    {
+      auiIdx2DepthValue[uiNumDepthValues++] = p;
+    }
+  }
+  
+  if( uiNumFrames == 0 || ceil(Log2(uiNumDepthValues)) == ceil(Log2(g_uiIBDI_MAX)) )
+  {
+    // don't use DLT
+    m_acTEncDepthTopList[iViewIdx]->setUseDLT(false);
+    m_acTEncDepthTopList[iViewIdx]->getSPS()->setUseDLT(false);
+  }
+  
+  // assign LUT
+  if( m_acTEncDepthTopList[iViewIdx]->getUseDLT() )
+    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues);
+  else
+    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs();
+  
+  // free temporary memory
+  free(auiIdx2DepthValue);
+}
+#endif
 
 //! \}
Index: branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.h
===================================================================
--- branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.h	(revision 168)
+++ branches/HTM-4.1-dev2-RWTH/source/App/TAppEncoder/TAppEncTop.h	(revision 177)
@@ -161,4 +161,8 @@
   Void  xStoreVSORefPicsInBuffer();                                                   ///< read in External Ref pic from file and store in buffer
 #endif
+  
+#if RWTH_SDC_DLT_B0036
+  Void  xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames);
+#endif
 
 };// END CLASS DEFINITION TAppEncTop
