Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComPic.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComPic.cpp	(revision 57)
@@ -135,5 +135,5 @@
 
   /* there are no SEI messages associated with this picture initially */
-  m_SEIs = NULL;
+  m_SEIs.clear();
   m_bUsedByCurr = false;
   return;
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp	(revision 57)
@@ -2106,5 +2106,4 @@
     {
       pIlpPicList[i]->setIsLongTerm(1);  //mark ilp as long-term reference
-      pIlpPicList[i]->setIsUsedAsLongTerm(1);  //mark ilp as long-term reference
       m_apcRefPicList[REF_PIC_LIST_0][iOffset + i] = pIlpPicList[i]; 
       m_aiNumRefIdx[REF_PIC_LIST_0]++;
@@ -2118,5 +2117,4 @@
       {
         pIlpPicList[i]->setIsLongTerm(1);  //mark ilp as long-term reference
-        pIlpPicList[i]->setIsUsedAsLongTerm(1);  //mark ilp as long-term reference
         m_apcRefPicList[REF_PIC_LIST_1][iOffset + i] = pIlpPicList[i]; 
         m_aiNumRefIdx[REF_PIC_LIST_1]++;
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp	(revision 57)
@@ -144,4 +144,8 @@
   if(m_layerId>0)
   {
+    Int  numReorderPics[MAX_TLAYER];
+    Window &conformanceWindow = pcSPS->getConformanceWindow();
+    Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window();
+
     if (m_cIlpPic[0] == NULL)
     {
@@ -151,7 +155,7 @@
         //m_cIlpPic[j]->createWithOutYuv(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true);
 #if SVC_UPSAMPLING
-        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, pcSPS, true);
-#else
-        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
+        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true);
+#else
+        m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
 #endif
 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || REF_IDX_MFM
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCu.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCu.cpp	(revision 57)
@@ -1813,5 +1813,36 @@
 #endif
 
-
+#if (ENCODER_FAST_MODE)
+Void TEncCu::xCheckRDCostILRUni(TComDataCU *&rpcBestCU, TComDataCU *&rpcTempCU)
+{
+  UChar uhDepth = rpcTempCU->getDepth( 0 );
+
+  rpcTempCU->setDepthSubParts( uhDepth, 0 );
+
+#if SKIP_FLAG
+  rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
+#endif
+
+  rpcTempCU->setPartSizeSubParts  ( SIZE_2Nx2N,  0, uhDepth );  //2Nx2N
+  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
+  rpcTempCU->setCUTransquantBypassSubParts  ( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
+
+  Bool exitILR = m_pcPredSearch->predInterSearchILRUni( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
+
+  if(!exitILR)
+  {
+    return;
+  }
+
+  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
+
+  rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
+
+  xCheckDQP( rpcTempCU );
+  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
+
+  return;
+}
+#endif
 
 
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 57)
@@ -413,5 +413,5 @@
     pcSlice->setNalUnitType(getNalUnitType(pocCurr));
 #if REF_IDX_FRAMEWORK
-    if( m_layerId > 0 && (uiPOCCurr % m_pcCfg->getIntraPeriod() == 0) )
+    if( m_layerId > 0 && (pocCurr % m_pcCfg->getIntraPeriod() == 0) )
     {
       pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA);
Index: /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncTop.cpp	(revision 56)
+++ /branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncTop.cpp	(revision 57)
@@ -1109,4 +1109,8 @@
   if(m_layerId>0)
   {
+    Int  numReorderPics[MAX_TLAYER];
+    Window &conformanceWindow = m_cSPS.getConformanceWindow();
+    Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window();
+
     if (m_cIlpPic[0] == NULL)
     {
@@ -1116,7 +1120,7 @@
         //m_cIlpPic[j]->createWithOutYuv(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true);
 #if SVC_UPSAMPLING
-        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, &m_cSPS, true);
+        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
 #else
-        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
+        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
 #endif
 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM
