Index: branches/SHM-2.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 149)
+++ branches/SHM-2.0-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 150)
@@ -4213,4 +4213,11 @@
 
 #if AVC_SYNTAX && !ILP_DECODED_PICTURE
+#if !ILP_DECODED_PICTURE
+  const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow();
+  const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();
+
+  Int widthBL   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
+  Int heightBL  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
+#endif
   if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture
   {
Index: branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 149)
+++ branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 150)
@@ -116,5 +116,5 @@
   return;
 }
-#if REF_IDX_FRAMEWORK
+#if REF_IDX_FRAMEWORK && 0
 Void TComPic::createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps,  Bool bIsVirtual)
 {
Index: branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h	(revision 149)
+++ branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h	(revision 150)
@@ -103,5 +103,5 @@
   Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 
                         Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false );
-#if REF_IDX_FRAMEWORK
+#if REF_IDX_FRAMEWORK && 0
   Void          createWithOutYuv( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, TComSPS* pcSps = NULL, Bool bIsVirtual = false );  
   Void          setPicYuvRec(TComPicYuv *pPicYuv) { m_apcPicYuv[1]=pPicYuv; }
Index: branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 149)
+++ branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 150)
@@ -143,4 +143,11 @@
   if(m_layerId>0)
   {
+    g_bitDepthY     = pcSPS->getBitDepthY();
+    g_bitDepthC     = pcSPS->getBitDepthC();
+    g_uiMaxCUWidth  = pcSPS->getMaxCUWidth();
+    g_uiMaxCUHeight = pcSPS->getMaxCUHeight();
+    g_uiMaxCUDepth  = pcSPS->getMaxCUDepth();
+    g_uiAddCUDepth  = max (0, pcSPS->getLog2MinCodingBlockSize() - (Int)pcSPS->getQuadtreeTULog2MinSize() );
+
     Int  numReorderPics[MAX_TLAYER];
     Window &conformanceWindow = pcSPS->getConformanceWindow();
@@ -579,6 +586,11 @@
     fstream* pFile  = m_ppcTDecTop[0]->getBLReconFile();
     const Window &conf = pBLPic->getConformanceWindow();
+#if ILP_DECODED_PICTURE
+    UInt uiWidth    = pBLPic->getPicYuvRec()->getWidth();
+    UInt uiHeight   = pBLPic->getPicYuvRec()->getHeight();
+#else
     UInt uiWidth    = pBLPic->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();
     UInt uiHeight   = pBLPic->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();
+#endif
         
     if( pFile->good() )
@@ -1082,10 +1094,10 @@
 #if AVC_SYNTAX
 
-          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);
-#else
-          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);
-#endif
-#else
-          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, onformanceWindow, defaultDisplayWindow, numReorderPics, true);
+          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);
+#else
+          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);
+#endif
+#else
+          pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);
 #endif
         }
Index: branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 149)
+++ branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 150)
@@ -1206,4 +1206,11 @@
   if(m_layerId>0)
   {
+    g_bitDepthY     = m_cSPS.getBitDepthY();
+    g_bitDepthC     = m_cSPS.getBitDepthC();
+    g_uiMaxCUWidth  = m_cSPS.getMaxCUWidth();
+    g_uiMaxCUHeight = m_cSPS.getMaxCUHeight();
+    g_uiMaxCUDepth  = m_cSPS.getMaxCUDepth();
+    g_uiAddCUDepth  = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() );
+
     Int  numReorderPics[MAX_TLAYER];
     Window &conformanceWindow = m_cSPS.getConformanceWindow();
