Index: /branches/HTM-12.2-dev2-HHI/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-12.2-dev2-HHI/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1110)
+++ /branches/HTM-12.2-dev2-HHI/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1111)
@@ -1374,4 +1374,7 @@
   }
 
+#if H_MV_FIX_NUM_VIEWS
+  vps.initNumViews(); 
+#endif
   Int maxViewId = xGetMax( m_viewId ); 
 
Index: /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp	(revision 1110)
+++ /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.cpp	(revision 1111)
@@ -1879,4 +1879,7 @@
   m_vpsBaseLayerAvailableFlag = true; 
 
+#if  H_MV_FIX_NUM_VIEWS
+  m_numViews = 0; 
+#endif
 
 #endif
@@ -1924,4 +1927,5 @@
   m_vpsNonVuiExtensionLength = 0;
   m_splittingFlag    = false;
+
   
   for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ )
@@ -2199,4 +2203,43 @@
 
 
+#if H_MV_FIX_NUM_VIEWS
+Void     TComVPS::initNumViews( )
+{
+  Int m_numViews = 1; 
+#if HHI_VIEW_ID_LIST_I5_J0107
+#if H_3D
+  AOF( m_viewOIdxList.size() == 0 ); 
+  m_viewOIdxList.push_back( 0 );        
+#endif
+#endif
+
+  for( Int i = 0; i <=  getMaxLayersMinus1(); i++ )
+  {
+    Int lId = getLayerIdInNuh( i ); 
+    if( i > 0 )
+    {
+      Bool newViewFlag = true; 
+      for( Int j = 0; j < i; j++ )
+      {
+        if( getViewOrderIdx( lId )  ==  getViewOrderIdx( getLayerIdInNuh( j ) )  )
+        {
+          newViewFlag = false;
+        }
+      }
+      if( newViewFlag )
+      {
+        m_numViews++;
+#if HHI_VIEW_ID_LIST_I5_J0107
+#if H_3D
+        m_viewOIdxList.push_back( getViewOrderIdx( lId ) );        
+#endif
+#endif
+      }
+    }
+  }
+}
+#endif
+
+
 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
 {
@@ -2357,4 +2400,5 @@
 }
 
+#if !H_MV_FIX_NUM_VIEWS
 Int TComVPS::getNumViews()
 {
@@ -2368,7 +2412,8 @@
     }    
   }
-
   return numViews;
 }
+#endif
+
 
 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 1110)
+++ /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TComSlice.h	(revision 1111)
@@ -884,4 +884,7 @@
   Int         m_dependencyFlag           [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
 
+#if H_MV_FIX_NUM_VIEWS
+  Int         m_numViews; 
+#endif
   Int         m_numDirectRefLayers       [MAX_NUM_LAYERS];
   Int         m_idDirectRefLayer         [MAX_NUM_LAYERS][MAX_NUM_LAYERS];  
@@ -949,4 +952,11 @@
   Int         ***m_aaaiCodedScale ;
   Int         ***m_aaaiCodedOffset;
+
+#if H_MV_FIX_NUM_VIEWS
+#if HHI_VIEW_ID_LIST_I5_J0107
+  std::vector<Int>  m_viewOIdxList;
+#endif
+#endif
+
 #endif
 #if !HHI_TOOL_PARAMETERS_I2_J0107
@@ -1186,5 +1196,13 @@
   Int     getAuxId        ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), AUX_ID  ); }    
   Int     getDependencyId ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPENDENCY_ID  ); }    
+#if H_MV_FIX_NUM_VIEWS
+  Int     getNumViews()                                                    { return m_numViews; }
+  Void    initNumViews();
+#if HHI_VIEW_ID_LIST_I5_J0107
+  Int     getViewOIdxList( Int i )                                         { return m_viewOIdxList[i]; }
+#endif
+#else
   Int     getNumViews();
+#endif
 
   Bool    getDependencyFlag( Int i, Int j )                                { return m_dependencyFlag[i][j]; }
Index: /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1110)
+++ /branches/HTM-12.2-dev2-HHI/source/Lib/TLibCommon/TypeDef.h	(revision 1111)
@@ -298,6 +298,8 @@
 #define HHI_TOOL_PARAMETERS_I2_J0107           1
 #define HHI_VPS_3D_EXTENSION_I3_J0107          1
+#define HHI_VIEW_ID_LIST_I5_J0107              0
 #endif
 #define H_MV_FIX_REF_LAYER_PIC_FLAG            1
+#define H_MV_FIX_NUM_VIEWS                     1
 #define H_3D_OUTPUT_ACTIVE_TOOLS               0
 
Index: /branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1110)
+++ /branches/HTM-12.2-dev2-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1111)
@@ -1330,4 +1330,8 @@
   }
 
+#if H_MV_FIX_NUM_VIEWS
+  pcVPS->initNumViews(); 
+#endif
+
   READ_CODE( 4, uiCode, "view_id_len" ); pcVPS->setViewIdLen( uiCode );
 
@@ -2022,6 +2026,12 @@
 
   READ_UVLC( uiCamParPrecision, "cp_precision" );
+#if HHI_VIEW_ID_LIST_I5_J0107
+  for (Int n = 1; n < pcVPS->getNumViews(); n++)
+  {
+    Int viewIndex = pcVPS->getViewOIdxList( n ); 
+#else
   for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
   {
+#endif
     pcVPS->setCamParPresent         ( viewIndex, false );
     pcVPS->setHasCamParInSliceHeader( viewIndex, false );
@@ -2032,6 +2042,8 @@
       if ( !bCamParSlice )
       {
-        for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )
-        {
+#if HHI_VIEW_ID_LIST_I5_J0107
+        for( UInt m = 0; m < n; n++ )
+        {
+          Int uiBaseIndex = pcVPS->getViewOIdxList ( m ); 
           Int iCode; 
           READ_SVLC( iCode, "vps_cp_scale" );                m_aaiTempScale  [ uiBaseIndex ][ viewIndex ]   = iCode;
@@ -2042,4 +2054,16 @@
       }
       pcVPS->initCamParaVPS( viewIndex, bCamParPresentFlag, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset ); 
+#else
+        for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )
+        {
+          Int iCode; 
+          READ_SVLC( iCode, "vps_cp_scale" );                m_aaiTempScale  [ uiBaseIndex ][ viewIndex ]   = iCode;
+          READ_SVLC( iCode, "vps_cp_off" );                  m_aaiTempOffset [ uiBaseIndex ][ viewIndex ]   = iCode;
+          READ_SVLC( iCode, "vps_cp_inv_scale_plus_scale" ); m_aaiTempScale  [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ];
+          READ_SVLC( iCode, "vps_cp_inv_off_plus_off" );     m_aaiTempOffset [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ];
+        }
+      }
+      pcVPS->initCamParaVPS( viewIndex, bCamParPresentFlag, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset ); 
+#endif
     }
   }
