Index: trunk/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 189)
+++ trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 210)
@@ -44,5 +44,9 @@
 
 TComSlice::TComSlice()
+#if QC_MVHEVC_B0046
+: m_iPPSId                        ( 0  )
+#else
 : m_iPPSId                        ( -1 )
+#endif
 , m_iPOC                          ( 0 )
 , m_iLastIDR                      ( 0 )
@@ -142,4 +146,11 @@
   resetWpScalingLC(m_weightPredTableLC);
   initWpAcDcParam();
+#if QC_IV_AS_LT_B0046
+  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF+1; iNumCount++)
+  {
+     m_bWasLongTerm[0][iNumCount] = false;
+     m_bWasLongTerm[1][iNumCount] = false;
+  }
+#endif
 }
 
@@ -472,5 +483,9 @@
   {
     pcRefPic = xGetInterViewRefPic( rapcInterViewRefPics, getViewId() + m_pcSPS->getUsableInterViewRef(i) );
+#if QC_IV_AS_LT_B0046
+    pcRefPic->setIsLongTerm( 1 );
+#else
     pcRefPic->setIsLongTerm( 0 );
+#endif
     pcRefPic->getPicYuvRec()->extendPicBorder();
     RefPicSetIvCurr[NumPocIvCurr] = pcRefPic;
@@ -513,4 +528,7 @@
   {
     m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
+#if QC_IV_AS_LT_B0046
+    setWasLongTerm(m_apcRefPicList[0][cIdx]->getIsLongTerm(), REF_PIC_LIST_0, cIdx);
+#endif
   }
   if( m_eSliceType == P_SLICE )
@@ -524,4 +542,7 @@
     {
       m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
+#if QC_IV_AS_LT_B0046
+      setWasLongTerm(m_apcRefPicList[1][cIdx]->getIsLongTerm(), REF_PIC_LIST_1, cIdx);
+#endif
     }
   }
@@ -876,5 +897,9 @@
     for(i=0;i<pReferencePictureSet->getNumberOfPositivePictures()+pReferencePictureSet->getNumberOfNegativePictures();i++)
     {
+#if QC_IV_AS_LT_B0046
+       if( rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i))
+#else
       if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i))
+#endif
       {
         isReference = 1;
@@ -886,5 +911,9 @@
     for(;i<pReferencePictureSet->getNumberOfPictures();i++)
     {
+#if QC_IV_AS_LT_B0046
+     if( (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
+#else
       if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
+#endif
       {
         isReference = 1;
@@ -1390,4 +1419,42 @@
 // Video parameter set (VPS)
 // ------------------------------------------------------------------------------------------------
+#if QC_MVHEVC_B0046
+TComVPS::TComVPS()
+: m_VPSId                     (  0)
+, m_uiMaxTLayers              (  1)
+, m_uiMaxLayers               (  1)
+, m_bTemporalIdNestingFlag    (false)
+, m_uiNumHRDParameter         (  0)
+, m_numAddiLayerOperationPoints (2)
+, m_numAddiProLevelSets       (  1)
+{
+  for( Int i = 0; i < MAX_LAYER_NUM; i++)
+  {
+  m_numOpLayerIdMinus1[i] = 0;
+  if(i)
+      m_numDirectRefLayer[i] = 1;
+  else
+    m_numDirectRefLayer[i] = 0;
+  for( Int j = 0; j < MAX_LAYER_NUM; j++)
+  {
+    m_numDirectRefID[i][j] = 0;
+    m_numOpLayerId[i][j]   = 0;
+  }
+    m_uiViewId[i] = 0;
+    m_iViewOrderIdx[i] = 0;
+  }
+  
+  for( Int i = 0; i < MAX_TLAYER; i++)
+  {
+    m_numReorderPics[i] = 0;
+    m_uiMaxDecPicBuffering[i] = 0; 
+    m_uiMaxLatencyIncrease[i] = 0;
+  }
+}
+
+TComVPS::~TComVPS()
+{
+}
+#else
 #if VIDYO_VPS_INTEGRATION
 TComVPS::TComVPS()
@@ -1422,5 +1489,5 @@
 
 #endif
-
+#endif
 
 // ------------------------------------------------------------------------------------------------
@@ -1429,5 +1496,5 @@
 
 TComSPS::TComSPS()
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
 : m_VPSId                     (  0)
 , m_SPSId                     (  0)
@@ -1481,5 +1548,9 @@
 , m_bLCMod                    (false)
 #if H0412_REF_PIC_LIST_RESTRICTION
+#if QC_MVHEVC_B0046
+, m_restrictedRefPicListsFlag   (  0)
+#else
 , m_restrictedRefPicListsFlag   (  1)
+#endif
 , m_listsModificationPresentFlag(  0)
 #endif
@@ -1522,4 +1593,7 @@
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
 , m_bUseDMM                   (false)
+#endif
+#if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX
+, m_bUseDMM34                   (false)
 #endif
 #if OL_QTLIMIT_PREDCODING_B0068
@@ -1734,8 +1808,9 @@
 TComSPS::initMultiviewSPS( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
 {
+#if !QC_MVHEVC_B0046
   AOT( uiViewId == 0 && iViewOrderIdx != 0 );
   AOT( uiViewId != 0 && iViewOrderIdx == 0 );
   AOT( uiViewId != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) );
-
+#endif
   m_uiViewId              = uiViewId;
   m_iViewOrderIdx         = iViewOrderIdx;
@@ -1745,4 +1820,5 @@
   ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
   ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
+#if !QC_MVHEVC_B0046
   if( !m_bCamParInSliceHeader )
   {
@@ -1755,4 +1831,5 @@
     }
   }
+#endif
 }
 
@@ -2374,5 +2451,5 @@
 , m_ppsMap(MAX_NUM_PPS)
 , m_apsMap(MAX_NUM_APS)
-#if VIDYO_VPS_INTEGRATION
+#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
 , m_vpsMap(MAX_NUM_VPS)
 #endif
