Index: branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1275)
@@ -3631,5 +3631,5 @@
   if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
   {
-#if H_3D_IC
+#if NH_3D_IC
     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag );
 #else
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.cpp	(revision 1275)
@@ -564,5 +564,5 @@
 Bool g_disableNumbering = false; 
 Bool g_disableHLSTrace = false; 
-UInt64 g_stopAtCounter       = 0; 
+UInt64 g_stopAtCounter       = 4660; 
 Bool g_traceCopyBack         = false; 
 Bool g_decTraceDispDer       = false; 
@@ -704,10 +704,10 @@
   }
   Bool stopFlag = false; 
-  if ( g_stopAtPos && poc == 0 && layerId == 2 )
+  if ( g_stopAtPos && poc == 16 && layerId == 1 )
   {
     Bool stopAtCU = true; 
     if ( stopAtCU )        // Stop at CU with specific size
     {    
-      stopFlag = ( cuPelX  == 0 ) && ( cuPelY  == 0 ) && ( cuWidth == 8 ) && ( cuHeight == 8 ); 
+      stopFlag = ( cuPelX  == 0 ) && ( cuPelY  == 0 ) && ( cuWidth == 32 ) && ( cuHeight == 32 ); 
     }
     else
@@ -729,16 +729,21 @@
   if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt  ) 
   {
-    if ( g_stopAtCounter == g_nSymbolCounter )
-    {
-      std::cout << "Break point here." << std::endl; 
-    }
+    incSymbolCounter();  
     if ( !g_disableNumbering )
     {  
-      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
     }
     fprintf( g_hTrace, "%-50s       : %d\n", symbolName, val );     
-    fflush ( g_hTrace );
-    g_nSymbolCounter++; 
-  }
+    fflush ( g_hTrace );   
+  }
+}
+Int incSymbolCounter( )
+{
+  g_nSymbolCounter++;  
+  if ( g_stopAtCounter == g_nSymbolCounter )
+  {
+    std::cout << "Break point here." << std::endl; 
+  }  
+  return g_nSymbolCounter; 
 }
 Void writeToTraceFile( const Char* symbolName, Bool doIt )
@@ -746,7 +751,7 @@
   if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt  ) 
   {
+    incSymbolCounter(); 
     fprintf( g_hTrace, "%s", symbolName );    
-    fflush ( g_hTrace );
-    g_nSymbolCounter++; 
+    fflush ( g_hTrace );    
   }
 }
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.h	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComRom.h	(revision 1275)
@@ -201,4 +201,5 @@
  Void           writeToTraceFile( const Char* symbolName, Int val, Bool doIt );
  Void           writeToTraceFile( const Char* symbolName, Bool doIt );
+ Int            incSymbolCounter();          
  Void           stopAtPos       ( Int poc, Int layerId, Int cuPelX, Int cuPelY, Int cuWidth, Int cuHeight );           
 #endif
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/SyntaxElementParser.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1275)
@@ -63,8 +63,9 @@
   if ( !g_disableNumbering )
   {
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-  }
+    incSymbolCounter();
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+  }
+#else
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
 #endif
   if (length < 10)
@@ -93,8 +94,9 @@
   if ( !g_disableNumbering )
   {
-#endif
+  incSymbolCounter();
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+  }
+#else
   fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-  }
 #endif
   fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue );
@@ -115,9 +117,10 @@
   }
   if ( !g_disableNumbering )
-  {
-#endif
-  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-  }
+  {  
+    incSymbolCounter();
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+  }
+#else
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
 #endif
   fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, rValue );
@@ -139,8 +142,9 @@
   if ( !g_disableNumbering )
   {
-#endif
+    incSymbolCounter(); 
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+  }
+#else
   fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-  }
 #endif
   fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, rValue );
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1275)
@@ -261,9 +261,5 @@
   }
   Int numValidMergeCand = 0;
-#if !NH_3D
   Bool hasMergedCandList = false;
-#else
-  Bool isMerged = false;
-#endif
 
   pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
@@ -309,5 +305,5 @@
   decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
 #endif
-#if H_3D_IC
+#if NH_3D_IC
   decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
@@ -319,4 +315,12 @@
     {
       UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
+#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
+      if (bDebugPredEnabled)
+      {
+        std::cout << "Coded merge flag, CU absPartIdx: " << uiAbsPartIdx << " PU(" << uiPartIdx << ") absPartIdx: " << uiSubPartIdx;
+        std::cout << " merge index: " << (UInt)pcCU->getMergeIndex(uiSubPartIdx) << std::endl;
+      }
+#endif
+
 #if NH_3D_DBBP
       if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false )
@@ -325,15 +329,20 @@
 #endif
       {
-        pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
-        if ( !isMerged )
-        {
+        if ( !hasMergedCandList )
+        {
+          pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set.
+
+#if NH_3D_MLC
 #if NH_3D_VSP
           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if H_3D_SPIVMP
+#endif
+#if NH_3D_SPIVMP
           memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
 #endif
           pcSubCU->initAvailableFlags();
-          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
+#endif
+          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
+#if NH_3D_MLC
           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
 #if NH_3D_SPIVMP
@@ -341,35 +350,34 @@
 #endif
             , numValidMergeCand );
-          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
+          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
+#if NH_3D_VSP
+            , vspFlag
+#endif
 #if NH_3D_SPIVMP
             , bSPIVMPFlag
 #endif
             , numValidMergeCand );
+#if NH_3D_VSP
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
-#else
-#if H_3D
-          pcSubCU->initAvailableFlags();
-          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
-          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
-
-#else
-          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
-#endif
-#endif
-          isMerged = true;
-        }
-        pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth );
+#endif
+#endif
+          pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore.
+          hasMergedCandList = true;
+        }
       }
       else
       {
-        uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
+#if NH_3D_MLC
 #if NH_3D_VSP
         Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
         memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if H_3D_SPIVMP
+#endif
+#if NH_3D_SPIVMP
         memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
 #endif
         pcSubCU->initAvailableFlags();
+#endif
         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
+#if NH_3D_MLC
         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
 #if NH_3D_SPIVMP
@@ -377,17 +385,14 @@
 #endif
           ,numValidMergeCand, uiMergeIndex );
-        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
+        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
+#if NH_3D_VSP
+          , vspFlag
+#endif
 #if NH_3D_SPIVMP
           , bSPIVMPFlag
 #endif
           ,numValidMergeCand );
+#if NH_3D_VSP
         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
-#else
-#if H_3D
-        pcSubCU->initAvailableFlags();
-        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
-        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
-#else
-        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
 #endif
 #endif
@@ -397,5 +402,5 @@
       TComMv cTmpMv( 0, 0 );
       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
-      {        
+      {
         if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
         {
@@ -424,5 +429,5 @@
         }
       }
-#if H_3D_SPIVMP
+#if NH_3D_SPIVMP
       pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );  
       if (bSPIVMPFlag[uiMergeIndex] != 0)
@@ -455,4 +460,14 @@
         {
           decodeMvsAMVP   ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
+#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
+          if (bDebugPredEnabled)
+          {
+            std::cout << "refListIdx: " << uiRefListIdx << std::endl;
+            std::cout << "MVD horizontal: " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getHor() << std::endl;
+            std::cout << "MVD vertical:   " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getVer() << std::endl;
+            std::cout << "MVPIdxPU: " << pcCU->getMVPIdx(RefPicList( uiRefListIdx ), uiSubPartIdx) << std::endl;
+            std::cout << "InterDir: " << (UInt)pcCU->getInterDir(uiSubPartIdx) << std::endl;
+          }
+#endif
         }
       }
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1275)
@@ -90,5 +90,10 @@
   g_bJustDoIt = g_bEncDecTraceEnable;
 #endif
+#if H_MV_ENC_DEC_TRAC
+  incSymbolCounter(); 
+  DTRACE_CABAC_VL( g_nSymbolCounter );
+#else
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
+#endif
   DTRACE_CABAC_T( "\tPOC: " );
   DTRACE_CABAC_V( pcPic->getPOC() );
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1275)
@@ -52,8 +52,9 @@
     if ( !g_disableNumbering )
     {
-#endif
+      incSymbolCounter();
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+    }
+#else
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-    }
 #endif
 
@@ -77,8 +78,9 @@
     if ( !g_disableNumbering )
     {
-#endif
+      incSymbolCounter(); 
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+    }
+#else
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-    }
 #endif
 
@@ -95,8 +97,9 @@
     if ( !g_disableNumbering )
     {
-#endif
+      incSymbolCounter(); 
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+    }
+#else
     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
-#if H_MV_ENC_DEC_TRAC
-    }
 #endif
 
@@ -113,9 +116,11 @@
     if ( !g_disableNumbering )
     {
+      incSymbolCounter();
+      fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter );
+    }
+#else
+     fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
 #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-14.1-update-dev2/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1275)
@@ -1908,5 +1908,5 @@
 #if NH_3D_ARP
   Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
-#if H_3D_IC
+#if NH_3D_IC
   if( nARPWMax < 0 || bICFlag )
 #else
@@ -2256,5 +2256,5 @@
     Bool bFirstTime = true;
     Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
-#if H_3D_IC
+#if NH_3D_IC
     if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
 #else
Index: branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1274)
+++ branches/HTM-14.1-update-dev2/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1275)
@@ -1121,5 +1121,10 @@
   g_bJustDoIt = g_bEncDecTraceEnable;
 #endif
+#if H_MV_ENC_DEC_TRAC
+  incSymbolCounter();
+  DTRACE_CABAC_VL( g_nSymbolCounter );
+#else
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
+#endif
   DTRACE_CABAC_T( "\tPOC: " );
   DTRACE_CABAC_V( pcPic->getPOC() );
