Index: branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp	(revision 1109)
+++ branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp	(revision 1110)
@@ -1878,4 +1878,6 @@
   m_vpsBaseLayerInternalFlag = true; 
   m_vpsBaseLayerAvailableFlag = true; 
+
+
 #endif
 
@@ -1913,4 +1915,7 @@
   m_repFormatIdxPresentFlag = false; 
   m_maxOneActiveRefLayerFlag = false; 
+#if H_MV_HLS_FIX
+  m_vpsPocLsbAlignedFlag  = false; 
+#endif
   m_directDepTypeLenMinus2   = 0;         
   
@@ -2366,5 +2371,4 @@
   return numViews;
 }
-
 
 Void TComVPS::deriveLayerSetLayerIdList()
Index: branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.h	(revision 1109)
+++ branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.h	(revision 1110)
@@ -861,5 +861,5 @@
   TComRepFormat* m_repFormat             [MAX_NUM_LAYERS]; 
   Bool        m_maxOneActiveRefLayerFlag;       
-#if H_MV_HLS7_GEN
+#if H_MV_HLS7_GEN || H_MV_HLS_FIX
   Bool        m_vpsPocLsbAlignedFlag;
 #endif
@@ -1146,5 +1146,5 @@
   Bool    getMaxOneActiveRefLayerFlag( )                                   { return m_maxOneActiveRefLayerFlag; } 
 
-#if H_MV_HLS7_GEN
+#if H_MV_HLS7_GEN || H_MV_HLS_FIX
   Void    setVpsPocLsbAlignedFlag( Bool flag )                             { m_vpsPocLsbAlignedFlag = flag; } 
   Bool    getVpsPocLsbAlignedFlag(  )                                      { return m_vpsPocLsbAlignedFlag; } 
@@ -2880,6 +2880,12 @@
   Int  getPocMsbVal(  ) { return m_pocMsbVal; } 
 
+#if H_MV_HLS_FIX
+  Bool getCraOrBlaPicFlag() { return ( getCraPicFlag() || getBlaPicFlag() ); } 
+  Bool getPocMsbValRequiredFlag() { return ( getCraOrBlaPicFlag() && ( getVPS()->getVpsPocLsbAlignedFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 ) );  }
+#else
   Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; }
   Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; }
+#endif
+
 
   UInt getPocLsbValLen() { return getSPS()->getBitsForPOC(); }; //log2_max_pic_order_cnt_lsb_minus4 + 4  
Index: branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1109)
+++ branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1110)
@@ -383,4 +383,6 @@
 /////////////////////////////////////////////////////////////////////////////////
 // TBD: Check if integration is necessary. 
+
+#define H_MV_HLS_FIX                         1
 #define H_MV_HLS_PTL_LIMITS                  0
 #define H_MV_HLS7_GEN                        0  // General changes (not tested)
Index: branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1109)
+++ branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1110)
@@ -1071,5 +1071,48 @@
   READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 );
   READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode );
+#if H_MV_HLS_FIX
+
+  UInt numRefLocOffsets;; 
+  READ_UVLC( numRefLocOffsets, "num_ref_loc_offsets" );
+
+  // All of the following stuff is not needed, but allowed to be present.
+  for (Int i = 0; i < numRefLocOffsets; i++ )
+  { 
+    Int   iCode = 0; 
+    READ_CODE( 6, uiCode, "ref_loc_offset_layer_id" ); 
+    READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" );
+
+    if (uiCode)
+    {    
+      READ_SVLC( iCode, "scaled_ref_layer_left_offset" );   
+      READ_SVLC( iCode, "scaled_ref_layer_top_offset" );    
+      READ_SVLC( iCode, "scaled_ref_layer_right_offset" );  
+      READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); 
+    }
+
+    READ_FLAG( uiCode, "ref_region_offset_present_flag" );  
+    if (uiCode)
+    {    
+      READ_SVLC( iCode, "ref_region_left_offset" );     
+      READ_SVLC( iCode, "ref_region_top_offset" );      
+      READ_SVLC( iCode, "ref_region_right_offset" );    
+      READ_SVLC( iCode, "ref_region_bottom_offset" );   
+    }
+
+    READ_FLAG( uiCode, "resample_phase_set_present_flag" );
+    if (uiCode)
+    {      
+      READ_UVLC( uiCode, "phase_hor_luma" );             
+      READ_UVLC( uiCode, "phase_ver_luma" );             
+      READ_UVLC( uiCode, "phase_hor_chroma_plus8" );     
+      READ_UVLC( uiCode, "phase_ver_chroma_plus8" );     
+    }
+  }
+  READ_FLAG( uiCode, "colour_mapping_enabled_flag" );   
+  // This is required to equal to 0 for Multiview Main profile. 
+  assert( uiCode == 0 ); 
+#else
   READ_UVLC( uiCode, "num_ref_loc_offsets" ); assert( uiCode == 0 );
+#endif
 }
 
@@ -1394,5 +1437,9 @@
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
+#if H_MV_HLS_FIX
+    if( pcVPS->getNumLayerSets() > 2 && i >= pcVPS->getNumLayerSets( ) )    
+#else
     if( i >= pcVPS->getNumLayerSets( ) )    
+#endif
     {        
       READ_CODE( pcVPS->getLayerSetIdxForOlsMinus1Len( i ), uiCode, "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode ); 
@@ -1465,5 +1512,6 @@
 
   READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 
-#if H_MV_HLS7_GEN
+
+#if H_MV_HLS7_GEN || H_MV_HLS_FIX
   READ_FLAG( uiCode, "vps_poc_lsb_aligned_flag" ); pcVPS->setVpsPocLsbAlignedFlag( uiCode == 1 );
 #endif
@@ -1515,4 +1563,7 @@
     parseVPSVUI( pcVPS ); 
   }     
+#if H_MV_HLS_FIX
+  else
+#endif
   {
     TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
@@ -2129,5 +2180,5 @@
     rpcSlice->checkCrossLayerBlaFlag( ); 
 
-#if !H_MV_HLS7_GEN
+#if !H_MV_HLS7_GEN && !H_MV_HLS_FIX
     if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     {
@@ -2838,9 +2889,15 @@
 
     // Derive the value of PocMs8bValRequiredFlag
+#if !H_MV_HLS_FIX
     rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()
                                           /* || TODO related to vps_poc_lsb_aligned_flag */
                                           );
-
+#endif
+
+#if H_MV_HLS_FIX
+    if( !rpcSlice->getPocMsbValRequiredFlag() && rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() )
+#else
     if( !rpcSlice->getPocMsbValRequiredFlag() /* TODO &&  rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
+#endif
     {
       READ_FLAG( uiCode, "poc_msb_val_present_flag" ); rpcSlice->setPocMsbValPresentFlag( uiCode == 1 );
Index: branches/HTM-12.2-dev2-HHI/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-12.2-dev2-HHI/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1109)
+++ branches/HTM-12.2-dev2-HHI/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1110)
@@ -871,4 +871,8 @@
   WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
   WRITE_UVLC( 0, "num_ref_loc_offsets" );
+#if H_MV_HLS_FIX
+  WRITE_FLAG( 0 , "colour_mapping_enabled_flag" );
+#endif
+
 }
 
@@ -1185,5 +1189,9 @@
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
+#if H_MV_HLS_FIX
+    if( pcVPS->getNumLayerSets() > 2 && i >= pcVPS->getNumLayerSets( ) )    
+#else
     if( i >= pcVPS->getNumLayerSets( ) )    
+#endif
     {      
       WRITE_CODE( pcVPS->getLayerSetIdxForOlsMinus1( i ), pcVPS->getLayerSetIdxForOlsMinus1Len( i ) ,      "layer_set_idx_for_ols_minus1[i]" );
@@ -1255,5 +1263,5 @@
 
   WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" );
-#if H_MV_HLS7_GEN
+#if H_MV_HLS7_GEN || H_MV_HLS_FIX
   WRITE_FLAG( pcVPS->getVpsPocLsbAlignedFlag( ) ? 1 : 0 , "vps_poc_lsb_aligned_flag" );
 #endif
@@ -1305,4 +1313,7 @@
     codeVPSVUI( pcVPS ); 
   }     
+#if H_MV_HLS_FIX
+  else
+#endif
   {
     TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
@@ -1775,5 +1786,5 @@
     }
     pcSlice->checkCrossLayerBlaFlag( ); 
-#if !H_MV_HLS7_GEN
+#if !H_MV_HLS7_GEN && !H_MV_HLS_FIX
     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     {
@@ -2218,7 +2229,9 @@
   {
     // Derive the value of PocMsbValRequiredFlag
+#if !H_MV_HLS_FIX
     pcSlice->setPocMsbValRequiredFlag( pcSlice->getCraPicFlag() || pcSlice->getBlaPicFlag()
                                           /* || related to vps_poc_lsb_aligned_flag */
                                           );
+#endif
 
     // Determine value of SH extension length.
@@ -2238,5 +2251,9 @@
 
 
+#if H_MV_HLS_FIX
+    if( !pcSlice->getPocMsbValRequiredFlag() &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() )
+#else
     if( !pcSlice->getPocMsbValRequiredFlag() /* TODO &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
+#endif
     {
       shExtnLengthInBit++;    // For poc_msb_val_present_flag
@@ -2301,5 +2318,9 @@
     pcSlice->checkPocLsbVal(); 
 
+#if H_MV_HLS_FIX
+    if( !pcSlice->getPocMsbValRequiredFlag() &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag()  )
+#else
     if( !pcSlice->getPocMsbValRequiredFlag() /* TODO &&  pcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
+#endif
     {
       WRITE_FLAG( pcSlice->getPocMsbValPresentFlag( ) ? 1 : 0 , "poc_msb_val_present_flag" );
