Index: branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.cpp	(revision 751)
+++ branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.cpp	(revision 753)
@@ -2581,6 +2581,6 @@
 }
 
-#if RWTH_DELTA_DLT
-Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum )
+#if H_3D_DELTA_DLT
+Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum )
 {
   Bool abBM0[ 256 ];
@@ -2591,5 +2591,5 @@
   
   // convert reference DLT to bit string
-  for( Int i = 0; i < iDLTInRefNum; i++ )
+  for( Int i = 0; i < uiDLTInRefNum; i++ )
   {
     abBM0[ piDLTInRef[ i ] ] = true;
@@ -2601,16 +2601,16 @@
   }
   
-  *piDeltaDLTOutNum = 0;
+  *puiDeltaDLTOutNum = 0;
   for( Int i = 0; i < 256; i++ )
   {
     if( abBM0[ i ] ^ abBM1[ i ] )
     {
-      piDeltaDLTOut[ *piDeltaDLTOutNum ] = i;
-      *piDeltaDLTOutNum = *piDeltaDLTOutNum + 1;
-    }
-  }
-}
-
-Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum )
+      piDeltaDLTOut[ *puiDeltaDLTOutNum ] = i;
+      *puiDeltaDLTOutNum = *puiDeltaDLTOutNum + 1;
+    }
+  }
+}
+
+Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum )
 {
   Bool abBM0[ 256 ];
@@ -2621,10 +2621,10 @@
   
   // convert reference DLT to bit string
-  for( Int i = 0; i < iDLTInRefNum; i++ )
+  for( Int i = 0; i < uiDLTInRefNum; i++ )
   {
     abBM0[ piDLTInRef[ i ] ] = true;
   }
   // convert delta DLT to bit string
-  for( Int i = 0; i < piDeltaDLTInNum; i++ )
+  for( Int i = 0; i < uiDeltaDLTInNum; i++ )
   {
     abBM1[ piDeltaDLTIn[ i ] ] = true;
Index: branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.h	(revision 751)
+++ branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.h	(revision 753)
@@ -1204,8 +1204,4 @@
   Int         m_iNumDepthViews;
   UInt        m_uiDepthViewBitDepth;
-  
-#if RWTH_DELTA_DLT
-  Bool        m_bUseDeltaDLTFlag         [ MAX_NUM_LAYERS ];
-#endif
 
 public:
@@ -1218,13 +1214,7 @@
   Bool    getUseDLTFlag      ( Int layerIdInVps )         { return m_bUseDLTFlag[ layerIdInVps ]; }
   Void    setUseDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ]  = b;   }
-
-#if RWTH_DELTA_DLT
-  Bool    getUseDeltaDLTFlag      ( Int layerIdInVps )         { return m_bUseDeltaDLTFlag[ layerIdInVps ]; }
-  Void    setUseDeltaDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDeltaDLTFlag[ layerIdInVps ]  = b;   }
-#endif
   
   Bool    getInterViewDltPredEnableFlag( Int layerIdInVps )         { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; }
   Void    setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b;    }
-
 
   Void    setNumDepthViews   ( Int n )                    { m_iNumDepthViews = n; }
@@ -1239,7 +1229,8 @@
   Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
   Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
-#if RWTH_DELTA_DLT
-  Void    getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum );
-  Void    setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum );
+#if H_3D_DELTA_DLT
+  Int*    idx2DepthValue( Int layerIdInVps )  { return m_iIdx2DepthValue[layerIdInVps]; }
+  Void    getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum );
+  Void    setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum );
 #endif
 };
Index: branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TypeDef.h	(revision 751)
+++ branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TypeDef.h	(revision 753)
@@ -222,5 +222,5 @@
 #define Log2( n ) ( log((double)n) / log(2.0) )
 #endif
-#define RWTH_DELTA_DLT                    1
+#define H_3D_DELTA_DLT                    1
 #endif
 
Index: branches/HTM-9.1-dev0-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-9.1-dev0-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 751)
+++ branches/HTM-9.1-dev0-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 753)
@@ -412,5 +412,4 @@
           if ( pcDLT->getUseDLTFlag( i ) )
           {
-            UInt uiNumDepthValues     = 0;
             Bool bDltBitMapRepFlag    = false;
             UInt uiMaxDiff            = 0xffffffff;
@@ -430,11 +429,11 @@
               bDltBitMapRepFlag = false;
             }
+            
+            UInt uiNumDepthValues = 0;
+            Int  aiIdx2DepthValue[256];
 
             // Bit map
             if ( bDltBitMapRepFlag )
             {
-              UInt uiNumDepthValues = 0;
-              Int  aiIdx2DepthValue[256]; 
-
               for (UInt d=0; d<256; d++)
               {
@@ -446,6 +445,4 @@
                 }
               }
-
-              pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
             }
             // Diff Coding
@@ -454,9 +451,9 @@
               READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
 
+#if !H_3D_DELTA_DLT
               if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )       // Single-view DLT Diff Coding
+#endif
               {
                 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 
-
-                Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
 
                 if (uiNumDepthValues > 1)
@@ -501,9 +498,27 @@
                 }
 
-                pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
-
-                free(aiIdx2DepthValue);
-              }              
+              }
             }
+            
+#if H_3D_DELTA_DLT
+            if( pcDLT->getInterViewDltPredEnableFlag( i ) )
+            {
+              // interpret decoded values as delta DLT
+              AOF( pcVPS->getDepthId( 1 ) == 1 );
+              AOF( i > 1 );
+              // assumes ref layer id to be 1
+              Int* piRefDLT = pcDLT->idx2DepthValue( 1 );
+              UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
+              pcDLT->setDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);
+            }
+            else
+            {
+              // store final DLT
+              pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
+            }
+#else
+            // store final DLT
+            pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
+#endif
           }
         }
Index: branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 751)
+++ branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 753)
@@ -299,5 +299,5 @@
             WRITE_FLAG( pcDLT->getInterViewDltPredEnableFlag( i ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ i ]");
 
-            // determine whether to use bit-map
+            // ----------------------------- determine whether to use bit-map -----------------------------
             Bool bDltBitMapRepFlag       = false;
             UInt uiNumBitsNonBitMap      = 0;
@@ -310,13 +310,34 @@
 
             UInt* puiDltDiffValues       = NULL;
-
-            if ( NULL == (puiDltDiffValues = (UInt *)calloc(pcDLT->getNumDepthValues(i), sizeof(UInt))) )
+            
+            Int aiIdx2DepthValue_coded[256];
+            UInt uiNumDepthValues_coded = 0;
+            
+            uiNumDepthValues_coded = pcDLT->getNumDepthValues(i);
+            for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ )
+            {
+              aiIdx2DepthValue_coded[ui] = pcDLT->idx2DepthValue(i, ui);
+            }
+            
+#if H_3D_DELTA_DLT
+            if( pcDLT->getInterViewDltPredEnableFlag( i ) )
+            {
+              AOF( pcVPS->getDepthId( 1 ) == 1 );
+              AOF( i > 1 );
+              // assumes ref layer id to be 1
+              Int* piRefDLT = pcDLT->idx2DepthValue( 1 );
+              UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
+              pcDLT->getDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, &uiNumDepthValues_coded);
+            }
+#endif
+
+            if ( NULL == (puiDltDiffValues = (UInt *)calloc(uiNumDepthValues_coded, sizeof(UInt))) )
             {
               exit(-1);
             }
 
-            for (UInt d = 1; d < pcDLT->getNumDepthValues(i); d++)
+            for (UInt d = 1; d < uiNumDepthValues_coded; d++)
             {
-              puiDltDiffValues[d] = pcDLT->idx2DepthValue(i, d) - pcDLT->idx2DepthValue(i, (d-1));
+              puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1];
 
               if ( uiMaxDiff < puiDltDiffValues[d] )
@@ -335,10 +356,10 @@
             uiNumBitsNonBitMap += 8;                          // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ])
 
-            if ( pcDLT->getNumDepthValues(i) > 1 )
+            if ( uiNumDepthValues_coded > 1 )
             {
               uiNumBitsNonBitMap += 8;                        // u(v) bits for max_diff[ layerId ]
             }
 
-            if ( pcDLT->getNumDepthValues(i) > 2 )
+            if ( uiNumDepthValues_coded > 2 )
             {
               uiLengthMinDiff    = (UInt) ceil(Log2(uiMaxDiff + 1));
@@ -351,5 +372,5 @@
             {
               uiLengthDltDiffMinusMin = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1));
-              uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (pcDLT->getNumDepthValues(i) - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
+              uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
             }
 
@@ -360,5 +381,5 @@
             bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true;
 
-            // Actual coding
+            // ----------------------------- Actual coding -----------------------------
             if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )
             {
@@ -376,5 +397,5 @@
               for (UInt d=0; d < 256; d++)
               {
-                if ( d == pcDLT->idx2DepthValue(i, uiDltArrayIndex) )
+                if ( d == aiIdx2DepthValue_coded[uiDltArrayIndex] )
                 {                  
                   WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]");
@@ -390,24 +411,26 @@
             else
             {
-              WRITE_CODE(pcDLT->getNumDepthValues(i), 8, "num_depth_values_in_dlt[layerId]");    // num_entry
-
+              WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[layerId]");    // num_entry
+
+#if !H_3D_DELTA_DLT
               if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )   // Single-view DLT Diff Coding
+#endif
               {
-                // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 
-                if ( pcDLT->getNumDepthValues(i) > 1 )
+                // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
+                if ( uiNumDepthValues_coded > 1 )
                 {
                   WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]");        // max_diff
                 }
 
-                if ( pcDLT->getNumDepthValues(i) > 2 )
+                if ( uiNumDepthValues_coded > 2 )
                 {
                   WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]");     // min_diff_minus1
                 }
 
-                WRITE_CODE(pcDLT->idx2DepthValue(i, 0), 8, "dlt_depth_value0[layerId]");          // entry0
+                WRITE_CODE(aiIdx2DepthValue_coded[0], 8, "dlt_depth_value0[layerId]");          // entry0
 
                 if (uiMaxDiff > uiMinDiff)
                 {
-                  for (UInt d=1; d < pcDLT->getNumDepthValues(i); d++)
+                  for (UInt d=1; d < uiNumDepthValues_coded; d++)
                   {
                     WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");    // entry_value_diff_minus_min[ k ]
