Index: branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 401)
@@ -151,4 +151,9 @@
      * nal unit. */
     streampos location = bitstreamFile.tellg();
+#if H_MV
+#if ENC_DEC_TRACE
+    Int64 symCount = g_nSymbolCounter;
+#endif
+#endif
     AnnexBStats stats = AnnexBStats();
 #if !H_MV
@@ -246,4 +251,10 @@
           bitstreamFile.seekg(location-streamoff(3));
           bytestream.reset();
+#if H_MV
+#if ENC_DEC_TRACE
+          g_nSymbolCounter = symCount;
+#endif
+#endif
+
         }
 #if !H_MV
@@ -591,3 +602,55 @@
 }
 
+#if H_MV
+Int TAppDecTop::xGetDecoderIdx( Int layerId, Bool createFlag /*= false */ )
+{
+  Int decIdx = -1; 
+  if ( m_layerIdToDecIdx[ layerId ] != -1 ) 
+  {      
+    decIdx = m_layerIdToDecIdx[ layerId ]; 
+  }
+  else
+  {      
+    assert ( createFlag ); 
+    assert( m_numDecoders < MAX_NUM_LAYERS ); 
+
+    decIdx = m_numDecoders; 
+
+    // Init decoder
+    m_tDecTop[ decIdx ] =  new TDecTop;
+    m_tDecTop[ decIdx ]->create();
+    m_tDecTop[ decIdx ]->init( );
+    m_tDecTop[ decIdx ]->setLayerId( layerId );
+    m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
+    m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 
+
+    // append pic list of new decoder to PicLists 
+    assert( m_ivPicLists.size() == m_numDecoders );
+    m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() );
+
+    // create recon file related stuff      
+    Char* pchTempFilename = NULL;
+    if ( m_pchReconFile )
+    {      
+      Char buffer[4];      
+      sprintf(buffer,"_%i", layerId );
+      assert ( m_pchReconFile ); 
+      xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );
+      assert( m_pchReconFiles.size() == m_numDecoders );
+    }
+
+    m_pchReconFiles.push_back( pchTempFilename );   
+
+    m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv;
+    m_reconOpen           [ decIdx ] = false;
+
+    // set others 
+    m_pocLastDisplay      [ decIdx ] = -MAX_INT;
+    m_layerIdToDecIdx     [ layerId ] = decIdx; 
+
+    m_numDecoders++; 
+  };
+  return decIdx;
+}
+#endif
 //! \}
Index: branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.h
===================================================================
--- branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 401)
@@ -97,54 +97,5 @@
   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file
   Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file
-  Int   xGetDecoderIdx    ( Int layerId, Bool createFlag = false )
-  { 
-    Int decIdx = -1; 
-    if ( m_layerIdToDecIdx[ layerId ] != -1 ) 
-    {      
-      decIdx = m_layerIdToDecIdx[ layerId ]; 
-    }
-    else
-    {      
-      assert ( createFlag ); 
-      assert( m_numDecoders < MAX_NUM_LAYERS ); 
-
-      decIdx = m_numDecoders; 
-      
-      // Init decoder
-      m_tDecTop[ decIdx ] =  new TDecTop;
-      m_tDecTop[ decIdx ]->create();
-      m_tDecTop[ decIdx ]->init( );
-      m_tDecTop[ decIdx ]->setLayerId( layerId );
-      m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
-      m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 
-     
-      // append pic list of new decoder to PicLists 
-      assert( m_ivPicLists.size() == m_numDecoders );
-      m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() );
-
-      // create recon file related stuff      
-      Char* pchTempFilename = NULL;
-      if ( m_pchReconFile )
-      {      
-        Char buffer[4];      
-        sprintf(buffer,"_%i", layerId );
-        assert ( m_pchReconFile ); 
-        xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );
-        assert( m_pchReconFiles.size() == m_numDecoders );
-      }
-
-      m_pchReconFiles.push_back( pchTempFilename );   
-
-      m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv;
-      m_reconOpen           [ decIdx ] = false;
-
-      // set others 
-      m_pocLastDisplay      [ decIdx ] = -MAX_INT;
-      m_layerIdToDecIdx     [ layerId ] = decIdx; 
-
-      m_numDecoders++; 
-    };
-    return decIdx; 
-  }
+  Int   xGetDecoderIdx    ( Int layerId, Bool createFlag = false );
 #else
   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic , UInt tId); ///< write YUV to file
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 401)
@@ -578,5 +578,9 @@
   {
 #if L0323_DPB
+#if H_MV
+    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
+#else
     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");
+#endif
     pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
 #else
@@ -584,7 +588,15 @@
     pcSPS->setMaxDecPicBuffering( uiCode, i);
 #endif
+#if H_MV
+    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
+#else
     READ_UVLC ( uiCode, "sps_num_reorder_pics" );
+#endif
     pcSPS->setNumReorderPics(uiCode, i);
+#if H_MV
+    READ_UVLC ( uiCode, "sps_max_latency_increase[i]");
+#else
     READ_UVLC ( uiCode, "sps_max_latency_increase");
+#endif
     pcSPS->setMaxLatencyIncrease( uiCode, i );
 
@@ -694,5 +706,5 @@
 {
   UInt  uiCode;
-  
+   
   READ_CODE( 4,  uiCode,  "vps_video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
   READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
@@ -1204,6 +1216,7 @@
       }
     }
-    // }
+    // } 
     TComRefPicListModification* refPicListModification = rpcSlice->getRefPicListModification();
+
     if(!rpcSlice->isIntra())
     {
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 401)
@@ -50,7 +50,14 @@
   m_iMaxRefPicNum = 0;
 #if ENC_DEC_TRACE
+#if H_MV
+  if ( g_hTrace == NULL )
+  {
+#endif
   g_hTrace = fopen( "TraceDec.txt", "wb" );
   g_bJustDoIt = g_bEncDecTraceDisable;
   g_nSymbolCounter = 0;
+#if H_MV
+  }
+#endif
 #endif
   m_pocCRA = 0;
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 401)
@@ -185,4 +185,5 @@
 {
   {
+#if !H_MV
     DTRACE_CABAC_VL( g_nSymbolCounter++ )
     DTRACE_CABAC_T( "\tstate=" )
@@ -191,4 +192,5 @@
     DTRACE_CABAC_V( binValue )
     DTRACE_CABAC_T( "\n" )
+#endif
   }
   m_uiBinsCoded += m_binCountIncrement;
@@ -231,8 +233,10 @@
 {
   {
+#if !H_MV
     DTRACE_CABAC_VL( g_nSymbolCounter++ )
     DTRACE_CABAC_T( "\tEPsymbol=" )
     DTRACE_CABAC_V( binValue )
     DTRACE_CABAC_T( "\n" )
+#endif
   }
   m_uiBinsCoded += m_binCountIncrement;
@@ -259,8 +263,10 @@
   for ( Int i = 0; i < numBins; i++ )
   {
+#if !H_MV
     DTRACE_CABAC_VL( g_nSymbolCounter++ )
     DTRACE_CABAC_T( "\tEPsymbol=" )
     DTRACE_CABAC_V( ( binValues >> ( numBins - 1 - i ) ) & 1 )
     DTRACE_CABAC_T( "\n" )
+#endif
   }
   
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 401)
@@ -799,5 +799,9 @@
       TComReferencePictureSet altRps;
       Bool useAltRps = false;
+#if H_MV
+      if (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId() == 0 ) )
+#else
       if (pcSlice->getRapPicFlag())
+#endif
       {
         for (Int picIdx = 0; !useAltRps && picIdx < rps->getNumberOfPictures(); picIdx++)
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 401)
@@ -587,8 +587,10 @@
   if( pcCU->isIntra(uiAbsPartIdx) )
   {
+#if !H_MV
     DTRACE_CABAC_VL( g_nSymbolCounter++ )
     DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" )
     DTRACE_CABAC_V( uiDepth )
     DTRACE_CABAC_T( "\n" )
+#endif
   }
   else
Index: branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 396)
+++ branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 401)
@@ -2846,5 +2846,5 @@
   {
     Int numModifications = 0;
-    
+
     for( Int k = 0; k < ge.m_numInterViewRefPics; k++ ) 
     {
@@ -2853,11 +2853,10 @@
 
     // set inter-view modifications
+    Bool isModified = false;
+    Int tempList[16];
+    for( Int k = 0; k < 16; k++ ) { tempList[k] = -1; }
+
     if( (maxRefListSize > 1) && (numModifications > 0) )
     {
-      refPicListModification->setRefPicListModificationFlagL( li, true );
-      Int tempList[16];
-      for( Int k = 0; k < 16; k++ ) { tempList[k] = -1; }
-
-      Bool isModified = false;
       for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )
       {
@@ -2878,25 +2877,24 @@
         }
       }
-      if( isModified )
-      {
-        Int temporalRefIdx = 0;
-        for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )
-        {
-          if( tempList[i] >= 0 ) 
-          {
-            refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );
-          }
-          else
-          {
-            refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );
-            temporalRefIdx++;
-          }
-        }
-      }
-      else
-      {
-        refPicListModification->setRefPicListModificationFlagL( li, false );
-      }
-    }
+    }
+
+    refPicListModification->setRefPicListModificationFlagL( li, isModified );  
+
+    if( isModified )
+    {
+      Int temporalRefIdx = 0;
+      for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )
+      {
+        if( tempList[i] >= 0 ) 
+        {
+          refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );
+        }
+        else
+        {
+          refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );
+          temporalRefIdx++;
+        }
+      }
+    }    
   }
 }
