Index: trunk/source/Lib/TLibDecoder/NALread.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/NALread.cpp	(revision 189)
+++ trunk/source/Lib/TLibDecoder/NALread.cpp	(revision 210)
@@ -132,4 +132,9 @@
 #endif
 
+#if QC_MVHEVC_B0046
+  //nalu.m_layerId    = bs.read(6);
+  nalu.m_layerId    = bs.read(5);
+  nalu.m_temporalId = bs.read(3) - 1;
+#else
 #if H0388
   nalu.m_temporalId = bs.read(3);
@@ -145,5 +150,9 @@
   if ( nalu.m_temporalId )
   {
+#if QC_REM_IDV_B0046
+    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR);
+#else
     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDV );
+#endif
   }
 #endif
@@ -154,5 +163,7 @@
   case NAL_UNIT_CODED_SLICE_IDR:
 #if H0566_TLA
+#if !QC_REM_IDV_B0046
   case NAL_UNIT_CODED_SLICE_IDV:
+#endif
   case NAL_UNIT_CODED_SLICE_CRA:
   case NAL_UNIT_CODED_SLICE_TLA:
@@ -175,5 +186,9 @@
       if (nalu.m_temporalId == 0)
       {
+#if QC_REM_IDV_B0046
+        assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR);
+#else
         assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV );
+#endif
       }
       else
@@ -190,4 +205,5 @@
   }
 #endif
+#endif
 }
 //! \}
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 210)
@@ -1338,5 +1338,83 @@
   }
 }
-
+#if QC_MVHEVC_B0046
+Void TDecCavlc::parseVPS(TComVPS* pcVPS)
+{
+  UInt  uiCode;
+  READ_CODE( 4, uiCode,  "video_parameter_set_id"   );       pcVPS->setVPSId( uiCode );
+  READ_FLAG( uiCode,     "temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
+  READ_CODE( 2, uiCode,  "vps_reserved_zero_2bits" );         assert( !uiCode );
+  READ_CODE( 6, uiCode,  "vps_max_layers_minus1" );               pcVPS->setMaxLayers( uiCode + 1 );
+  READ_CODE( 3, uiCode,  "vps_max_sub_layers_minus1" );      pcVPS->setMaxTLayers( uiCode + 1 );
+  READ_CODE( 12, uiCode, "vps_extension_offset"      );      assert( !uiCode );
+  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
+  {
+    READ_UVLC( uiCode,  "max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
+    READ_UVLC( uiCode,  "num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
+    READ_UVLC( uiCode,  "max_latency_increase[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
+  }
+  READ_UVLC( uiCode,                 "vps_num_hrd_parameters"   ); pcVPS->setNumHRDParameters(uiCode);
+  assert(pcVPS->getNumHRDParameters()==0);
+  for ( UInt i = 0; i < pcVPS->getNumHRDParameters(); i ++)
+  {
+   //   if( i > 0 )  
+    //{
+    //  READ_UVLC (0, "op_num_layer_id_values_minus1[ opIdx ]");
+    //  for( i = 0; i <= op_num_layer_id_values_minus1[ opIdx ]; i++ )  
+    //    READ_UVLC(0, 6, "op_layer_id[ opIdx ][ i ]");
+    //}  
+    //hrd_parameters( i  = =  0, vps_max_sub_layers_minus1 );  
+  }
+ 
+  READ_CODE( 1, uiCode, "bit_equal_to_one" );             assert( uiCode );
+  //vps_extension_byte_alignment_reserved_one_bit
+  xReadVPSAlignOne();
+  READ_CODE( 8, uiCode, "num_additional_layer_operation_points" );     pcVPS->setNumAddiLayerOperationPoints( uiCode );
+  READ_CODE( 8, uiCode, "num_additional_profile_level_sets"     );     pcVPS->setNumAddiProLevelSets( uiCode);
+
+
+  for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
+  {
+    READ_CODE( 4,  uiCode,             "num_types_zero_4bits[i]" );   assert( !uiCode );
+    READ_CODE( 4,  uiCode,             "type_zero_4bits[i]"      );   assert( !uiCode );
+    READ_CODE( 8,  uiCode,             "view_id[i]" );                pcVPS->setViewId(uiCode, i);
+    // WRITE_SVLC( pcVPS->getViewOrderIdx(i),                  "view_order_idx[i]" );
+    if(i)
+    {
+      READ_CODE( 6, uiCode,  "num_direct_ref_layers[ i ]" );    pcVPS->setNumDirectRefLayer(uiCode, i);
+      for (UInt j = 0; j< pcVPS->getNumDirectRefLayer(i); j++)
+      {
+        READ_CODE( 6, uiCode, "ref_layer_id[i][j]" );         pcVPS->setDirectRefLayerId (uiCode, i, j);
+      }
+    }
+  }
+  for( UInt i=1; i<=pcVPS->getNumAddiProLevelSets(); i++)
+  {
+    //profile_tier_level
+  }
+  for( UInt i=1; i<= pcVPS->getNumAddiLayerOperationPoints(); i++)
+  {   
+    if(pcVPS->getMaxLayers() == 3)
+    {
+      pcVPS->setNumOpLayerIdMinus1((i < pcVPS->getNumAddiLayerOperationPoints() ? 1: 2), (i-1)); 
+    }
+    else if( i==1 )
+    {
+      assert(pcVPS->getNumAddiLayerOperationPoints()==1);
+      pcVPS->setNumOpLayerIdMinus1(pcVPS->getMaxLayers()-1, (i-1)); 
+    }
+    READ_UVLC( uiCode,           "op_num_layer_id_values_minus1[ opIdx ]" ); pcVPS->setNumOpLayerIdMinus1(uiCode, i-1);
+    for(UInt j = 0; j <= pcVPS->getNumOpLayerIdMinus1(i-1); j++ )
+    {
+      READ_UVLC( uiCode,           "op_layer_id[ opIdx ][ i ]" ); pcVPS->setNumOpLayerId(uiCode, i-1, j);
+    }
+    if (pcVPS->getNumAddiProLevelSets())
+    {
+      //profile_level_idx[ i ]
+    }
+  }
+  return;
+}
+#else
 #if VIDYO_VPS_INTEGRATION
 Void TDecCavlc::parseVPS(TComVPS* pcVPS)
@@ -1389,5 +1467,5 @@
 
 #endif
-
+#endif
 #if HHI_MPI
 Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth)
@@ -1401,6 +1479,7 @@
   
   UInt  uiCode;
+#if !QC_MVHEVC_B0046
   Int   iCode;
-
+#endif
   READ_CODE( 8,  uiCode, "profile_idc" );                        pcSPS->setProfileIdc( uiCode );
   READ_CODE( 8,  uiCode, "reserved_zero_8bits" );
@@ -1645,4 +1724,5 @@
 #endif
   READ_FLAG( uiCode, "sps_extension_flag");
+#if !QC_MVHEVC_B0046
   if(uiCode)
   {
@@ -1803,4 +1883,5 @@
     }
   }
+#endif
 }
 
@@ -1907,5 +1988,13 @@
     }
 #endif
+#if QC_REM_IDV_B0046
+#if !QC_MVHEVC_B0046
+  if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && rpcSlice->getSPS()->getViewId() == 0) 
+#else
+  if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && rpcSlice->getViewId() == 0) 
+#endif
+#else
     if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR) 
+#endif
     { 
       READ_UVLC( uiCode, "idr_pic_id" );  //ignored
@@ -1941,6 +2030,13 @@
       }
       rpcSlice->setPOC( iPOCmsb+iPOClsb );
-
+#if QC_REM_IDV_B0046
+#if !QC_MVHEVC_B0046
+      if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR &&  rpcSlice->getSPS()->getViewId() && rpcSlice->getPOC() == 0 )
+#else
+      if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR &&  rpcSlice->getViewId() && rpcSlice->getPOC() == 0 )
+#endif
+#else
       if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && rpcSlice->getPOC() == 0 )
+#endif
       {
         TComReferencePictureSet* rps = rpcSlice->getLocalRPS();
@@ -2082,5 +2178,9 @@
     {
 #if H0412_REF_PIC_LIST_RESTRICTION
+#if QC_MVHEVC_B0046
+    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#else
       if( !rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#endif
       {
         refPicListModification->setRefPicListModificationFlagL0( 0 );
@@ -2153,5 +2253,9 @@
     {
 #if H0412_REF_PIC_LIST_RESTRICTION
+#if QC_MVHEVC_B0046
+    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#else
       if( !rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#endif
       {
         refPicListModification->setRefPicListModificationFlagL1( 0 );
@@ -2237,5 +2341,9 @@
       
 #if H0412_REF_PIC_LIST_RESTRICTION
-      if(rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#if QC_MVHEVC_B0046
+    if( rpcSlice->getViewId() && rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#else
+    if(rpcSlice->getSPS()->getListsModificationPresentFlag() )
+#endif
       {
 #endif
@@ -2944,4 +3052,29 @@
 }
 
+#if QC_MVHEVC_B0046
+/** Parse VPS alignment one bits.
+ * \returns Void
+ */
+Void TDecCavlc::xReadVPSAlignOne( )
+{
+  UInt uiNumberOfBits = m_pcBitstream->getNumBitsUntilByteAligned();
+
+  if(uiNumberOfBits)
+  {
+    UInt uiBits;
+    UInt uiSymbol;
+
+    for(uiBits = 0; uiBits < uiNumberOfBits; uiBits++)
+    {
+      xReadFlag( uiSymbol );
+
+      if(!uiSymbol)
+      {
+        printf("\nWarning! vps_extension_byte_alignment_reserved_one_bit include a non-zero value.\n");
+      }
+    }
+  }
+}
+#endif
 /** Parse PCM alignment zero bits.
  * \returns Void
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 210)
@@ -75,5 +75,7 @@
   Void  xReadFlagTr           (              UInt& rValue, const Char *pSymbolName);
 #endif
-  
+#if QC_MVHEVC_B0046
+  Void  xReadVPSAlignOne      ();
+#endif
   Void  xReadPCMAlignZero     ();
 
@@ -113,5 +115,5 @@
   Void  parseQtRootCbf      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   Void  parseVPS            ( TComVPS* pcVPS );
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 210)
@@ -71,5 +71,5 @@
 #endif
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
 #endif
@@ -175,5 +175,5 @@
   Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   Void    decodeVPS                   ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 210)
@@ -87,5 +87,5 @@
   Void  setBitstream              ( TComInputBitstream* p  ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
   
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   Void  parseVPS                  ( TComVPS* pcVPS )  {}
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 210)
@@ -446,5 +446,5 @@
 , m_ppsBuffer(16)
 , m_apsBuffer(64)
-#if VIDYO_VPS_INTEGRATION 
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 
 , m_vpsBuffer(16)
 #endif
@@ -458,5 +458,5 @@
 }
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
 TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS  (Int vpsId)
 {
@@ -513,5 +513,5 @@
   m_ppsMap.mergePSList(m_ppsBuffer);
   m_spsMap.mergePSList(m_spsBuffer);
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   m_vpsMap.mergePSList(m_vpsBuffer);
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecSlice.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSlice.h	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecSlice.h	(revision 210)
@@ -96,5 +96,5 @@
   Void     storePrefetchedAPS(TComAPS *aps)  { m_apsBuffer.storePS( aps->getAPSID(), aps); };
   TComAPS* getPrefetchedAPS  (Int apsId);
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   Void     storePrefetchedVPS(TComVPS *vps)  { m_vpsBuffer.storePS( vps->getVPSId(), vps); };
   TComVPS* getPrefetchedVPS  (Int vpsId);
@@ -106,5 +106,5 @@
   ParameterSetMap<TComPPS> m_ppsBuffer; 
   ParameterSetMap<TComAPS> m_apsBuffer; 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 
   ParameterSetMap<TComVPS> m_vpsBuffer;
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 210)
@@ -50,4 +50,7 @@
   m_aaiCodedScale          = new Int* [ MAX_VIEW_NUM ];
   m_aiViewOrderIndex       = new Int  [ MAX_VIEW_NUM ];
+#if QC_MVHEVC_B0046
+  m_aiViewId               = new Int  [ MAX_VIEW_NUM ];
+#endif
   m_aiViewReceived         = new Int  [ MAX_VIEW_NUM ];
   for( UInt uiId = 0; uiId < MAX_VIEW_NUM; uiId++ )
@@ -266,4 +269,7 @@
   m_bFirstSliceInSequence   = true;
   m_pcCamParsCollector = 0;
+#if QC_MVHEVC_B0046
+  m_bFirstNal                  = false;
+#endif
 }
 
@@ -578,5 +584,9 @@
   TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
   assert (vps != 0);
+#if !QC_REM_IDV_B0046
   if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )
+#else
+  if( (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) && !sps->getViewId() )
+#endif
     // VPS can only be activated on IDR or CRA...
     getTAppDecTop()->getVPSAccess()->setActiveVPSId( sps->getVPSId() );
@@ -584,5 +594,8 @@
   m_apcSlicePilot->setPPS(pps);
   m_apcSlicePilot->setSPS(sps);
-#if VIDYO_VPS_INTEGRATION
+#if QC_MVHEVC_B0046
+  TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
+#endif
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   m_apcSlicePilot->setVPS(vps);
 #endif
@@ -626,9 +639,23 @@
   m_apcSlicePilot->setPPS(m_parameterSetManagerDecoder.getPrefetchedPPS(0));
   m_apcSlicePilot->setSPS(m_parameterSetManagerDecoder.getPrefetchedSPS(0));
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
+#if QC_MVHEVC_B0046
+  m_apcSlicePilot->setIsDepth(false);
+#endif
   m_apcSlicePilot->setVPS(m_parameterSetManagerDecoder.getPrefetchedVPS(0));
 #endif
   m_apcSlicePilot->initTiles();
-
+#if QC_MVHEVC_B0046
+  m_apcSlicePilot->setViewId( nalu.m_layerId );
+  m_apcSlicePilot->setViewId( nalu.m_layerId );
+  m_apcSlicePilot->setViewOrderIdx(m_apcSlicePilot->getVPS()->getViewId(nalu.m_layerId), nalu.m_layerId);
+  Int iNumDirectRef = m_apcSlicePilot->getVPS()->getNumDirectRefLayer(nalu.m_layerId);
+  m_apcSlicePilot->getSPS()->setNumberOfUsableInterViewRefs(iNumDirectRef);
+  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
+  {
+    Int iDeltaLayerId = m_apcSlicePilot->getVPS()->getDirectRefLayerId( nalu.m_layerId, iNumIvRef);
+    m_apcSlicePilot->getSPS()->setUsableInterViewRef(iNumIvRef, (iDeltaLayerId-nalu.m_layerId));
+  }
+#endif
   if (m_bFirstSliceInPicture)
   {
@@ -645,4 +672,8 @@
   if( m_bFirstSliceInPicture )
   {
+#if QC_MVHEVC_B0046
+    if( nalu.m_layerId == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; }
+    else                     { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, 0 )->getNalUnitTypeBaseView(); }
+#else
 #if VIDYO_VPS_INTEGRATION
     if( m_apcSlicePilot->getVPS()->getViewId(nalu.m_layerId) == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; }
@@ -652,5 +683,5 @@
     else                     { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, nalu.m_isDepth )->getNalUnitTypeBaseView(); }
 #endif
-    
+#endif
     m_apcSlicePilot->setNalUnitTypeBaseViewMvc( m_nalUnitTypeBaseView );
   }
@@ -951,4 +982,5 @@
 
     // Set reference list 
+#if !QC_MVHEVC_B0046
 #if VIDYO_VPS_INTEGRATION
     pcSlice->setViewId( pcSlice->getVPS()->getViewId(nalu.m_layerId) );
@@ -958,4 +990,5 @@
     pcSlice->setIsDepth(m_isDepth);
 #endif
+#endif
 
 #if SONY_COLPIC_AVAILABILITY
@@ -969,6 +1002,16 @@
     assert( m_tAppDecTop != NULL );
     TComPic * const pcTexturePic = m_isDepth ? m_tAppDecTop->getPicFromView(  m_viewId, pcSlice->getPOC(), false ) : NULL;
+
+#if FLEX_CODING_ORDER_M23723
+    if (pcTexturePic != NULL)
+    {
+      assert( !m_isDepth || pcTexturePic != NULL );
+      pcSlice->setTexturePic( pcTexturePic );
+    }
+#else
     assert( !m_isDepth || pcTexturePic != NULL );
     pcSlice->setTexturePic( pcTexturePic );
+#endif
+
 
     std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
@@ -1071,4 +1114,12 @@
   m_cGopDecoder.decompressGop(nalu.m_Bitstream, pcPic, false);
 
+#if QC_IV_AS_LT_B0046
+  std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
+  for( Int k = 0; k < apcInterViewRefPics.size(); k++ )
+  {
+    TComPic*  pcPicIv = apcInterViewRefPics[k];
+    pcPicIv->setIsLongTerm( 0 );
+  }
+#endif
   if( m_pcCamParsCollector )
   {
@@ -1082,5 +1133,5 @@
 }
 
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
 Void TDecTop::xDecodeVPS()
 {
@@ -1089,5 +1140,7 @@
   m_cEntropyDecoder.decodeVPS( vps );
   m_parameterSetManagerDecoder.storePrefetchedVPS(vps);  
+#if !QC_MVHEVC_B0046
   getTAppDecTop()->getVPSAccess()->addVPS( vps );
+#endif
 }
 #endif
@@ -1155,5 +1208,5 @@
   switch (nalu.m_nalUnitType)
   {
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     case NAL_UNIT_VPS:
       xDecodeVPS();
@@ -1178,5 +1231,7 @@
     case NAL_UNIT_CODED_SLICE_IDR:
 #if H0566_TLA
+#if !QC_REM_IDV_B0046
     case NAL_UNIT_CODED_SLICE_IDV:
+#endif
     case NAL_UNIT_CODED_SLICE_CRA:
     case NAL_UNIT_CODED_SLICE_TLA:
@@ -1193,4 +1248,30 @@
 }
 
+#if QC_MVHEVC_B0046
+Void TDecTop::xCopyVPS( TComVPS* pVPSV0 )
+{
+  m_parameterSetManagerDecoder.storePrefetchedVPS(pVPSV0);  
+}
+
+Void TDecTop::xCopySPS( TComSPS* pSPSV0 )
+{
+  TComSPS* sps = new TComSPS();
+  sps = pSPSV0;
+  m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
+#if LCU_SYNTAX_ALF
+  m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
+#endif
+}
+
+Void TDecTop::xCopyPPS(TComPPS* pPPSV0 )
+{
+  m_parameterSetManagerDecoder.storePrefetchedPPS( pPPSV0 );
+
+  //!!!KS: Activate parameter sets for parsing APS (unless dependency is resolved)
+  m_apcSlicePilot->setPPSId(pPPSV0->getPPSId());
+  xActivateParameterSets();
+  m_apcSlicePilot->initTiles();
+}
+#endif
 /** Function for checking if picture should be skipped because of random access
  * \param iSkipFrame skip frame counter
Index: trunk/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 189)
+++ trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 210)
@@ -88,4 +88,7 @@
   Int**   m_aaiCodedScale;
   Int*    m_aiViewOrderIndex;
+#if QC_MVHEVC_B0046
+  Int*    m_aiViewId;
+#endif
   Int*    m_aiViewReceived;
   UInt    m_uiCamParsCodedPrecision;
@@ -168,5 +171,9 @@
   
   Void  deletePicBuffer();
-
+#if QC_MVHEVC_B0046
+  Void      xCopySPS( TComSPS* pSPSV0);
+  Void      xCopyPPS( TComPPS* pPPSV0);
+  Void      xCopyVPS( TComVPS* pVPSV0);
+#endif
 #if HHI_INTER_VIEW_RESIDUAL_PRED
   Void      deleteExtraPicBuffers   ( Int iPoc );
@@ -195,5 +202,8 @@
   TAppDecTop*         getTAppDecTop()                           { return  m_tAppDecTop; }
   NalUnitType         getNalUnitTypeBaseView()                  { return m_nalUnitTypeBaseView; }
-
+#if QC_MVHEVC_B0046
+  bool                m_bFirstNal; //used to copy SPS, PPS, VPS
+  ParameterSetManagerDecoder* xGetParaSetDec ()        {return  &m_parameterSetManagerDecoder;}
+#endif
 protected:
   Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
@@ -208,5 +218,5 @@
   Bool      xDecodeSlice(InputNALUnit &nalu, Int iSkipFrame, Int iPOCLastDisplay);
 #endif
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
   Void      xDecodeVPS();
 #endif
