Index: /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 769)
@@ -1743,6 +1743,5 @@
    * This permits the ability to omit a GOP structure specification */
 #if H_MV
-  if (m_iIntraPeriod[layer] == 1 && m_GOPList[0].m_POC == -1)
-  {
+  if (m_iIntraPeriod[layer] == 1 && m_GOPList[0].m_POC == -1) {
 #else
   if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) {
@@ -1773,7 +1772,7 @@
   Int numOK=0;
 #if H_MV
+  xConfirmPara( m_iIntraPeriod[layer] >=0&&(m_iIntraPeriod[layer]%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); 
+#else
 xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
-#else
-  xConfirmPara( m_iIntraPeriod[layer] >=0&&(m_iIntraPeriod[layer]%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); 
 #endif
 
Index: /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 769)
@@ -208,5 +208,5 @@
 
     m_cTEncTop.setIvPicLists                   ( &m_ivPicLists ); 
-  // H_MV
+#endif  // H_MV
   m_cTEncTop.setVPS(&vps);
 
@@ -1945,4 +1945,4 @@
 }
 #endif
-#endif
+
 //! \}
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 769)
@@ -110,5 +110,7 @@
 #endif
 , m_pocResetFlag                  (false)
+#if H_MV
 , m_crossLayerBlaFlag             (false)
+#endif
 , m_discardableFlag               (false)
 , m_interLayerPredEnabledFlag     (false)
@@ -1699,6 +1701,6 @@
 , m_hrdOpSetIdx               (NULL)
 , m_cprmsPresentFlag          (NULL)
+#if H_MV
 , m_dpbSize                   (NULL)
-#if H_MV
 , m_vpsVUI                 (  NULL )
 #endif
@@ -1787,5 +1789,4 @@
     m_ivMvScalingFlag = true; 
 #endif
-#endif
 
     for( Int j = 0; j < MAX_NUM_LAYERS; j++ )
@@ -1808,5 +1809,5 @@
   m_vpsVUI = new TComVPSVUI; 
   m_dpbSize = new TComDpbSize; 
-#
+
 #if H_3D
   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
@@ -1831,4 +1832,5 @@
 #endif
   }  
+#endif
 #endif
 }
@@ -2211,4 +2213,5 @@
   ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
   ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
+#if H_MV
   m_spsExtensionFlag = false; 
   for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 
@@ -2230,4 +2233,5 @@
     m_scaledRefLayerBottomOffset   [i] = 0;
   }
+#endif
 }
 
@@ -3774,3 +3778,2 @@
 }
 #endif
-
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 769)
@@ -53,4 +53,5 @@
 #if H_MV
 class TComPicLists; 
+class TComVPS; 
 #endif
 // ====================================================================================================================
@@ -62,5 +63,4 @@
 // ====================================================================================================================
 
-class TComVPS; 
 /// Reference Picture Set class
 class TComReferencePictureSet
@@ -829,6 +829,7 @@
   UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
   Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
+
+#if H_MV    
   UInt    getMaxSubLayersMinus1()             { return m_uiMaxTLayers - 1;  }  // For consistency with draft spec
-#if H_MV    
   UInt    getMaxLayersMinus1()                { return m_uiMaxLayersMinus1;  }; 
   Void    setMaxLayersMinus1(UInt l)          { m_uiMaxLayersMinus1 = l; }
@@ -989,5 +990,6 @@
 
   TComVPSVUI* getVPSVUI(  )                                                { return m_vpsVUI;  }
-  // VPS EXTENSION SEMANTICS VARIABLES
+ 
+ // VPS EXTENSION SEMANTICS VARIABLES
   Void    setLayerIdInVps( Int layerIdInNuh, Int val )                     { m_layerIdInVps[layerIdInNuh] = val;  }
   Int     getLayerIdInVps( Int layerIdInNuh )                              { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; }
@@ -2369,15 +2371,15 @@
   Bool getPocResetFlag(  ) { return m_pocResetFlag; } 
 
-Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 
-Bool getDiscardableFlag(  ) { return m_discardableFlag; } 
-
-Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } 
-Bool getInterLayerPredEnabledFlag(  ) { return m_interLayerPredEnabledFlag; } 
-
-Void setNumInterLayerRefPicsMinus1( Int  val ) { m_numInterLayerRefPicsMinus1 = val; } 
-Int  getNumInterLayerRefPicsMinus1(  ) { return m_numInterLayerRefPicsMinus1; } 
-
-Void setInterLayerPredLayerIdc( Int i, Int  val ) { m_interLayerPredLayerIdc[i] = val; } 
-Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 
+  Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 
+  Bool getDiscardableFlag(  ) { return m_discardableFlag; } 
+
+  Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } 
+  Bool getInterLayerPredEnabledFlag(  ) { return m_interLayerPredEnabledFlag; } 
+
+  Void setNumInterLayerRefPicsMinus1( Int  val ) { m_numInterLayerRefPicsMinus1 = val; } 
+  Int  getNumInterLayerRefPicsMinus1(  ) { return m_numInterLayerRefPicsMinus1; } 
+
+  Void setInterLayerPredLayerIdc( Int i, Int  val ) { m_interLayerPredLayerIdc[i] = val; } 
+  Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 
 
   // Additional variables derived in slice header semantics 
Index: /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 769)
@@ -55,5 +55,5 @@
 
 #ifndef HEVC_EXT
-#define HEVC_EXT                    0
+#define HEVC_EXT                    2
 #endif
 
@@ -233,5 +233,4 @@
 
 #if H_3D_DIM_DLT
-#define 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! 
 #define H_3D_DELTA_DLT                    1
 #endif
@@ -279,5 +278,9 @@
 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
-
+// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
+// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
+// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
+// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
+// !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!!
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -329,4 +332,6 @@
 #define MAX_NUM_BITSTREAM_PARTITIONS    100 ///< Maximum value is actually not specified 
 #define MAX_NUM_BSP_SCHED_COMBINATION   100 ///< Maximum value is actually not specified 
+#else
+#define MAX_NUM_LAYER_IDS                64
 #endif
 
@@ -845,5 +850,5 @@
   };
 
-
-#endif
-#endif
+#define 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
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 769)
@@ -937,7 +937,12 @@
 
   READ_FLAG( uiCode, "sps_extension_flag");
+#if H_MV
   pcSPS->setSpsExtensionFlag( uiCode ); 
   if (pcSPS->getSpsExtensionFlag( ) )
-  {
+#else
+  if (uiCode)
+#endif
+  {
+#if H_MV
     for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
     {
@@ -964,9 +969,12 @@
     if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC ))
     {   
+#endif
         while ( xMoreRbspData() )
         {
           READ_FLAG( uiCode, "sps_extension_data_flag");
         }
-    }
+#if H_MV
+    }
+#endif
   }
 }
@@ -1073,5 +1081,7 @@
     }
   }
+#if H_MV
   pcVPS->deriveLayerSetLayerIdList(); 
+#endif
   TimingInfo *timingInfo = pcVPS->getTimingInfo();
   READ_FLAG(       uiCode, "vps_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
@@ -1890,4 +1900,5 @@
 
 
+#if H_MV
     UInt slicePicOrderCntLsb = 0;
     Int iPOClsb = slicePicOrderCntLsb;  // Needed later
@@ -1936,7 +1947,11 @@
       rpcSlice->setPOC              ( 0 );
     }      
+#endif
 
     if( rpcSlice->getIdrPicFlag() )
     {
+#if !H_MV
+      rpcSlice->setPOC(0);
+#endif
       TComReferencePictureSet* rps = rpcSlice->getLocalRPS();
       rps->setNumberOfNegativePictures(0);
@@ -1951,4 +1966,33 @@
     else
     {
+#if !H_MV
+      READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb");  
+      Int iPOClsb = uiCode;
+      Int iPrevPOC = rpcSlice->getPrevTid0POC();
+      Int iMaxPOClsb = 1<< sps->getBitsForPOC();
+      Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1);
+      Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb;
+      Int iPOCmsb;
+      if( ( iPOClsb  <  iPrevPOClsb ) && ( ( iPrevPOClsb - iPOClsb )  >=  ( iMaxPOClsb / 2 ) ) )
+      {
+        iPOCmsb = iPrevPOCmsb + iMaxPOClsb;
+      }
+      else if( (iPOClsb  >  iPrevPOClsb )  && ( (iPOClsb - iPrevPOClsb )  >  ( iMaxPOClsb / 2 ) ) ) 
+      {
+        iPOCmsb = iPrevPOCmsb - iMaxPOClsb;
+      }
+      else
+      {
+        iPOCmsb = iPrevPOCmsb;
+      }
+      if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
+        || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
+        || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
+      {
+        // For BLA picture types, POCmsb is set to 0.
+        iPOCmsb = 0;
+      }
+      rpcSlice->setPOC              (iPOCmsb+iPOClsb);
+#endif
       TComReferencePictureSet* rps;
       rps = rpcSlice->getLocalRPS();
Index: /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 769)
@@ -725,5 +725,7 @@
 #endif
 
+#if H_MV
     xCeckNoClrasOutput();
+#endif
     // Skip pictures due to random access
     if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
@@ -731,5 +733,7 @@
     m_prevSliceSkipped = true;
     m_skippedPOC = m_apcSlicePilot->getPOC();
-      sliceSkippedFlag = true; 
+#if H_MV
+    sliceSkippedFlag = true; 
+#endif
       return false;
     }
@@ -739,5 +743,7 @@
     m_prevSliceSkipped = true;
     m_skippedPOC = m_apcSlicePilot->getPOC();
-      sliceSkippedFlag = true; 
+#if H_MV
+    sliceSkippedFlag = true; 
+#endif
       return false;
     }
@@ -1273,5 +1279,9 @@
     return true;
   }
+#if H_MV
   else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet.
+#else
+  else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet.
+#endif
   {
     if (   m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA
@@ -1281,4 +1291,5 @@
     {
 
+#if H_MV
       if ( xAllRefLayersInitilized() )
       {
@@ -1290,19 +1301,28 @@
         return true; 
       }
+#else
+      // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT.
+      m_pocRandomAccess = m_apcSlicePilot->getPOC();
+#endif
     }
     else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
     {
+#if H_MV
       if ( xAllRefLayersInitilized() )
       {
         m_layerInitilizedFlag[ m_layerId ] = true; 
+        m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
+      }
+      else 
+      {
+        return true; 
+      }
+#else
       m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
+#endif
     }
     else 
     {
-        return true; 
-      }
-    }
-    else 
-    {
+#if H_MV_FIX_SKIP_PICTURES
       static Bool warningMessage[MAX_NUM_LAYERS];
       static Bool warningInitFlag = false;
@@ -1322,4 +1342,12 @@
         warningMessage[m_layerId] = false; 
       }
+#else
+      static Bool warningMessage = false;
+      if(!warningMessage)
+      {
+        printf("\nWarning: this is not a valid random access point and the data is discarded until the first CRA picture");
+        warningMessage = true;
+      }
+#endif
       return true;
     }
@@ -1331,5 +1359,10 @@
     return true;
   }
+#if H_MV
   return !m_layerInitilizedFlag[ getLayerId() ]; 
+#else
+  // if we reach here, then the picture is not skipped.
+  return false; 
+#endif
 }
 
@@ -1373,4 +1406,5 @@
 }
 
+#if H_MV
 Void TDecTop::xCeckNoClrasOutput()
 {
@@ -1407,3 +1441,4 @@
 }
 #endif
+#endif
 //! \}
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 769)
@@ -1796,4 +1796,5 @@
 #endif
 #else
+#if H_3D
   rpcTempCU->m_bAvailableFlagA1 = 0;
   rpcTempCU->m_bAvailableFlagB1 = 0;
@@ -1803,4 +1804,7 @@
   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
+#else
+  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
+#endif
 #endif
 
Index: /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 768)
+++ /branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 769)
@@ -817,5 +817,9 @@
     pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
     pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
+#if H_MV
     pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 );
+#else
+   pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
+#endif
     pcVUI->setVideoFormat(getVideoFormat());
     pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
