Index: branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1305)
@@ -1360,5 +1360,5 @@
   ("IlluCompEnable"        ,                          m_abUseIC                 , true                          , "Enable illumination compensation"          )
   ("IlluCompLowLatencyEnc" ,                          m_bUseLowLatencyICEnc     , false                         , "Enable low-latency illumination compensation encoding")
-#endif //H_3D
+#endif //NH_3D
     
   ;
@@ -3599,5 +3599,5 @@
   }
 #endif //HHI_VSO
-#endif //H_3D
+#endif //NH_3D
   printf("\n");
 #if NH_MV
Index: branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1305)
@@ -302,5 +302,5 @@
     m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL  : false );
     m_cTEncTop.setSps3dExtension               ( m_sps3dExtension );
-#endif // H_3D
+#endif // NH_3D
 
     m_cTEncTop.setIvPicLists                   ( &m_ivPicLists ); 
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/CommonDef.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/CommonDef.h	(revision 1305)
@@ -391,5 +391,5 @@
 #define STD_CAM_PARAMETERS_PRECISION 5        ///< quarter luma sample accuarcy for derived disparities (as default)
 
-#endif // end of H_3D
+#endif // end of NH_3D
 //! \}
 
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1305)
@@ -3647,5 +3647,5 @@
       !bARPFlag &&
 #endif
-#if H_3D
+#if H_3D || NH_3D_FIX_VSP
       (nPSW + nPSH > 12) &&
 #endif
@@ -5627,5 +5627,5 @@
     if(!m_pcSlice->getIsDepth())
     {
-#if H_3D_DBBP
+#if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
       if (!getDBBPFlag(0))
 #else
@@ -5803,5 +5803,5 @@
       iCurrPosY  += ( iHeight >> 1 );
     }
-#if H_3D_DBBP
+#if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
     for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 
 #else
@@ -5878,5 +5878,5 @@
     }
 #if NH_3D_SPIVMP
-#if H_3D_DBBP
+#if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
     for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
 #else
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.h	(revision 1305)
@@ -50,9 +50,4 @@
 #include "TComPattern.h"
 
-#if H_3D
-#include <algorithm>
-#include <vector>
-#endif
-
 //! \ingroup TLibCommon
 //! \{
@@ -504,8 +499,4 @@
 #endif
 
-#if H_3D
-  Void          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
-  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
-#endif
 #if NH_3D_NBDV_REF
   Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp	(revision 1305)
@@ -62,5 +62,5 @@
 , m_layerId                               (0)
 , m_viewId                                (0)
-#if H_3D
+#if NH_3D
 , m_viewIndex                             (0)
 , m_isDepth                               (false)
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPicYuv.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1305)
@@ -324,10 +324,4 @@
 #endif
 
-#if H_3D
-Void TComPicYuv::setLumaTo( Pel pVal )
-{
-  xSetPels( getLumaAddr(), getStride(), getWidth(), getHeight(), pVal );
-}
-#endif
 #if NH_3D_VSO
 Void TComPicYuv::setChromaTo( Pel pVal )
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1305)
@@ -584,5 +584,5 @@
     pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
   }
-#if H_3D_ARP // check this!
+#if H_3D_ARP || NH_3D_ALIGN_SPIVMP_RP // check this!
   if( pcCU->getARPW( uiPartAddr ) != 0 )
   {
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp	(revision 1305)
@@ -551,5 +551,5 @@
 Bool g_decTraceMvFromMerge   = false; 
 Bool g_decTracePicOutput     = false; 
-Bool g_stopAtPos             = false; 
+Bool g_stopAtPos             = true; 
 Bool g_outputPos             = false;   
 Bool g_traceCameraParameters = false; 
@@ -686,10 +686,10 @@
   }
   Bool stopFlag = false; 
-  if ( g_stopAtPos && poc == 16 && layerId == 5 )
+  if ( g_stopAtPos && poc == 0 && layerId == 2 )
   {
     Bool stopAtCU = true; 
     if ( stopAtCU )        // Stop at CU with specific size
     {    
-      stopFlag = ( cuPelX  == 224 ) && ( cuPelY  == 128 ) && ( cuWidth == 16 ) && ( cuHeight == 16 ); 
+      stopFlag = ( cuPelX  == 416 ) && ( cuPelY  == 632 ) && ( cuWidth == 8 ) && ( cuHeight == 8 ); 
     }
     else
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1305)
@@ -2234,5 +2234,5 @@
   }
 }
-#endif // H_3D
+#endif // NH_3D
 
 
@@ -2503,5 +2503,5 @@
     auxId         .push_back( getAuxId       ( i ) );      
     viewId        .push_back( getViewId      ( getLayerIdInNuh( i ) ) );
-#if H_3D  
+#if NH_3D  
     depthId.push_back( getDepthId( i ) );
 #endif
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1305)
@@ -3094,12 +3094,4 @@
   Bool                        inferPocMsbValPresentFlag();
 #endif
-#if H_3D
-  Int                         getDefaultRefViewIdx()                                 { return m_iDefaultRefViewIdx;                                  }
-  Void                        setDefaultRefViewIdx(Int iViewIdx)                     { m_iDefaultRefViewIdx = iViewIdx;                              }
-
-  Bool                        getDefaultRefViewIdxAvailableFlag()                    { return m_bDefaultRefViewIdxAvailableFlag;                     }
-  Void                        setDefaultRefViewIdxAvailableFlag(Bool bViewIdx)       { m_bDefaultRefViewIdxAvailableFlag = bViewIdx;                 }
-  Void                        setDefaultRefView( );
-#endif
 protected:
   TComPic*                    xGetRefPic        (TComList<TComPic*>& rcListPic, Int poc);
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1305)
@@ -66,4 +66,10 @@
 /////////////////////////////////////////////////////////////////////////////////////////
 #if NH_MV
+#define NH_3D_DLT_FIX                     1 // Fixes numbers of parsed DLTs 
+#define H_MV_VER141_DEC_COMP_FLAG         1 // Makes decoding of this version compatible to HTM-14.1 by re-introducing HTM-14.1 bugs.
+#define NH_3D_ALIGN_SPIVMP_DBBP           1 // Further alignment of DBBP and SBP motion
+#define NH_3D_ALIGN_SPIVMP_RP             1 // Alignment of DBBP and RP
+#define NH_3D_FIX_VSP                     1 
+
 #define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
 #define H_MV_ENC_DEC_TRAC_FIX             1  // by SHARP
@@ -1149,6 +1155,3 @@
 };
 //! \}
-#if H_3D
-#define !!! REMOVE THIS !!! Log2( n ) ( log((double)n) / log(2.0) ) // Ed.(GT): This is very very bad and should be fixed to used integer arithmetics ( see gCeilLog2 ) moreover it should not be defined in the tool macro section! 
-#endif
-#endif
+#endif
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1305)
@@ -507,10 +507,18 @@
   {
     READ_CODE(6, uiCode, "pps_depth_layers_minus1");
+#if H_MV_VER141_DEC_COMP_FLAG
+    pcDLT->setNumDepthViews( uiCode );
+#else
     pcDLT->setNumDepthViews( uiCode+1 );
+#endif
     
     READ_CODE(4, uiCode, "pps_bit_depth_for_depth_layers_minus8");
     pcDLT->setDepthViewBitDepth( (uiCode+8) );
     
+#if NH_3D_DLT_FIX
+    for( Int i = 0; i <= pcDLT->getNumDepthViews()-1; i++ )
+#else
     for( Int i = 0; i <= pcDLT->getNumDepthViews(); i++ )
+#endif
     {
       Int layerId = pcDLT->getDepthIdxToLayerId(i);
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1305)
@@ -923,5 +923,5 @@
     }
     
-#if H_3D
+#if NH_3D
     AOF( pcCU->getARPW(uiPartAddr) == 0 );
     AOF( pcCU->getICFlag(uiPartAddr) == false );
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSbac.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSbac.h	(revision 1305)
@@ -79,9 +79,5 @@
   Void  parseVPS                  ( TComVPS* /*pcVPS*/ ) {}
   Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
-#if H_3D
-  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TComVPS* /*pcVPS*/ ) {}
-#else
   Void  parsePPS                  ( TComPPS* /*pcPPS*/ ) {}
-#endif
   Void  parseSliceHeader          ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/, const Int /*prevTid0POC*/) {}
   Void  parseTerminatingBit       ( UInt& ruiBit );
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1305)
@@ -130,8 +130,8 @@
     }
   }
-#if  H_3D
+#if  NH_3D_DLT
   if( pcSlice->getPPS()->getDLT() != NULL )
   {
-      assert( pcSlice->getSPS()->getBitDepthY() == pcSlice->getPPS()->getDLT()->getDepthViewBitDepth() );
+      assert( pcSlice->getSPS()->getBitDepth( CHANNEL_TYPE_LUMA ) == pcSlice->getPPS()->getDLT()->getDepthViewBitDepth() );
   }
 #endif
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1305)
@@ -1314,7 +1314,4 @@
   pps->setLayerId( getLayerId() ); 
 #endif
-#if H_3D
-  // GT: Please don't add parsing dependency of SPS from VPS here again!!!
-#endif
 #if NH_3D_DLT
   // create mapping from depth layer indexes to layer ids
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.h	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecTop.h	(revision 1305)
@@ -176,5 +176,5 @@
 };
 
-#endif //H_3D
+#endif //NH_3D
 /// decoder class
 class TDecTop
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1305)
@@ -380,5 +380,9 @@
     WRITE_CODE((pcPPS->getDLT()->getDepthViewBitDepth() - 8), 4, "pps_bit_depth_for_depth_layers_minus8");
     
+#if NH_3D_DLT_FIX
+    for( Int i = 0; i <= pcPPS->getDLT()->getNumDepthViews()-1; i++ )
+#else
     for( Int i = 0; i <= pcPPS->getDLT()->getNumDepthViews(); i++ )
+#endif
     {
       Int layerId = pcPPS->getDLT()->getDepthIdxToLayerId(i);
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1305)
@@ -2254,5 +2254,5 @@
 
   // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
-#if H_3D || NH_3D_ARP
+#if NH_3D_ARP
   const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
 #endif
Index: branches/HTM-14.1-update-dev1/source/Lib/TLibExtractor/TExtrTop.cpp
===================================================================
--- branches/HTM-14.1-update-dev1/source/Lib/TLibExtractor/TExtrTop.cpp	(revision 1304)
+++ branches/HTM-14.1-update-dev1/source/Lib/TLibExtractor/TExtrTop.cpp	(revision 1305)
@@ -74,10 +74,5 @@
   {
      TComSPS     cSPS;
-#if H_3D
-
      m_cEntropyDecoder   .decodeSPS( &cSPS );
-#else
-     m_cEntropyDecoder   .decodeSPS( &cSPS );
-#endif
      m_acSPSBuffer       .push_back( cSPS );
   }
@@ -111,7 +106,5 @@
     rcVpsInfoHandle << "LayerIdInNuh   = " << layerId                             << std::endl; 
     rcVpsInfoHandle << "ViewOrderIndex = " << m_cVPS.getViewIndex     ( layerId ) << std::endl;     
-#if H_3D    
     rcVpsInfoHandle << "DepthFlag      = " << m_cVPS.getDepthId       ( layerId ) << std::endl;     
-#endif
     rcVpsInfoHandle << "ViewId         = " << m_cVPS.getViewId        ( layerId ) << std::endl;     
   }
