Index: branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 500)
@@ -1313,14 +1313,32 @@
 #endif
 
-  xConfirmPara(  m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. "   ); 
-
-  for( Int dim = 0; dim < m_dimIds.size(); dim++ )
-  {
-    xConfirmPara( m_dimIds[dim].size() < m_numberOfLayers,  "DimensionId must be given for all layers and all dimensions. ");   
-    xConfirmPara( ( dim != viewDimPosition ) &&  (m_dimIds[dim][0] != 0), "DimensionId of layer 0 must be 0. " );
-    xConfirmPara( m_dimensionIdLen[dim] < 1 || m_dimensionIdLen[dim] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 
+  xConfirmPara(  m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. "   );   Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1]; 
+
+  dimBitOffset[ 0 ] = 0; 
+  for (Int j = 1; j <= ((Int) m_dimIds.size() - m_splittingFlag ? 1 : 0); j++ )
+  {
+    dimBitOffset[ j ] = dimBitOffset[ j - 1 ] + m_dimensionIdLen[ j - 1]; 
+  }
+
+  if ( m_splittingFlag )
+  {
+    dimBitOffset[ (Int) m_dimIds.size() ] = 6; 
+  }
+  
+  for( Int j = 0; j < m_dimIds.size(); j++ )
+  {    
+    xConfirmPara( m_dimIds[j].size() < m_numberOfLayers,  "DimensionId must be given for all layers and all dimensions. ");   
+    xConfirmPara( ( j != viewDimPosition ) &&  (m_dimIds[j][0] != 0), "DimensionId of layer 0 must be 0. " );
+    xConfirmPara( m_dimensionIdLen[j] < 1 || m_dimensionIdLen[j] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 
+     
+
     for( Int i = 1; i < m_numberOfLayers; i++ )
     {     
-      xConfirmPara(  ( m_dimIds[dim][i] < 0 ) || ( m_dimIds[dim][i] > ( ( 1 << m_dimensionIdLen[dim] ) - 1 ) )   , "DimensionId shall be in the range of 0 to 2^DimensionIdLen - 1. " );
+      xConfirmPara(  ( m_dimIds[j][i] < 0 ) || ( m_dimIds[j][i] > ( ( 1 << m_dimensionIdLen[j] ) - 1 ) )   , "DimensionId shall be in the range of 0 to 2^DimensionIdLen - 1. " );
+      if ( m_splittingFlag )
+      {
+        Int layerIdInNuh = (m_layerIdInNuh.size()!=1) ? m_layerIdInNuh[i] :  i; 
+        xConfirmPara( ( ( layerIdInNuh & ( (1 << dimBitOffset[ j + 1 ] ) - 1) ) >> dimBitOffset[ j ] )  != m_dimIds[j][ i ]  , "When Splitting Flag is equal to 1 dimension ids shall match values derived from layer ids. "); 
+      }
     }
   }
Index: branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 500)
@@ -1072,5 +1072,4 @@
 }
 
-
 Void TAppEncTop::xSetProfileTierLevel( TComVPS& vps )
 { 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.cpp	(revision 500)
@@ -167,5 +167,4 @@
         if  ( (*it)->opt->opt_duplicate ) continue; 
 #endif
-
         ostringstream line(ios_base::out);
         line << "  ";
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h	(revision 500)
@@ -162,5 +162,5 @@
 
 #ifndef ENC_DEC_TRACE
-# define ENC_DEC_TRACE 1
+# define ENC_DEC_TRACE 0
 #endif
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 500)
@@ -516,5 +516,4 @@
   TComPic*  rpsCurrList0[MAX_NUM_REF+1];
   TComPic*  rpsCurrList1[MAX_NUM_REF+1];
-
 #if H_MV  
   Int numPocTotalCurr = ( getInterRefEnabledInRPLFlag() ? ( NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr ) : 0 ) + getNumActiveRefLayerPics( );
@@ -1773,5 +1772,5 @@
 }
 
-Int TComVPS::inferLastDimsionIdLen()
+Int TComVPS::inferLastDimsionIdLenMinus1()
 {
   return ( 5 - xGetDimBitOffset( getNumScalabilityTypes() - 1 ) ); 
@@ -2428,5 +2427,4 @@
   }
 }
-
 Int TComSlice::xCeilLog2( Int val )
 {
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 500)
@@ -494,6 +494,5 @@
   UInt*       m_hrdOpSetIdx;
   Bool*       m_cprmsPresentFlag;
-  
-#if H_MV
+  #if H_MV
   UInt        m_vpsNumLayerSetsMinus1;
   Bool        m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1];
@@ -514,8 +513,4 @@
   TimingInfo  m_timingInfo;
 #endif
-
-
-
-
 
 #if H_MV
@@ -620,5 +615,4 @@
   Void    setMaxOpSets(UInt v)                                  { m_numOpSets = v;    }
 #endif
-
   Bool    getLayerIdIncludedFlag(UInt opsIdx, UInt id)          { return m_layerIdIncludedFlag[opsIdx][id]; }
   Void    setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id)  { m_layerIdIncludedFlag[opsIdx][id] = v;    }
@@ -736,5 +730,5 @@
   // inference
   Int     inferDimensionId     ( Int i, Int j );
-  Int     inferLastDimsionIdLen();
+  Int     inferLastDimsionIdLenMinus1();
 
 #if H_3D  
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 500)
@@ -57,5 +57,5 @@
 
 #ifndef HEVC_EXT
-#define HEVC_EXT                    2
+#define HEVC_EXT                    0
 #endif
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 500)
@@ -917,5 +917,5 @@
     if ( pcVPS->getSplittingFlag() )
     {
-      pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLen() );       
+      pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() );       
     }    
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 500)
@@ -127,5 +127,4 @@
   DTRACE_CABAC_V( rpcPic->getLayerId()  );
 #endif
-
   DTRACE_CABAC_T( "\n" );
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecTop.cpp	(revision 500)
@@ -76,4 +76,5 @@
   delete [] m_aaiCodedScale;
   delete [] m_aiViewId;  
+  delete [] m_aiLayerIdx; 
   delete [] m_bViewReceived;
 
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 500)
@@ -735,5 +735,5 @@
   if ( pcVPS->getSplittingFlag() )
   { // Ignore old dimension id length
-    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLen() );       
+    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLenMinus1() + 1 );       
   }    
 
@@ -1204,5 +1204,4 @@
       {
 #endif
-
       if ( pcSlice->getSliceType() == B_SLICE )
       {
Index: branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 498)
+++ branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 500)
@@ -655,5 +655,4 @@
     refPicListModification->setRefPicListModificationFlagL1(0);
 #if H_MV
-
     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     {
