Index: branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1577)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1578)
@@ -113,7 +113,4 @@
 #endif
   m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
-#if REDUCED_ENCODER_MEMORY
-  }
-#endif
 
   for( Int i = 0; i < MAX_LAYERS; i++ )
@@ -123,5 +120,8 @@
       m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
     }
-  }   
+  }
+#if REDUCED_ENCODER_MEMORY
+  }
+#endif
 
   // there are no SEI messages associated with this picture initially
@@ -189,6 +189,18 @@
   const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
 
+#if SVC_EXTENSION
+  const Window& conformanceWindow    = sps.getConformanceWindow();
+
   if (m_apcPicYuv[PIC_YUV_ORG    ]==NULL)
   {
+    m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
+  }
+  if (m_apcPicYuv[PIC_YUV_TRUE_ORG    ]==NULL)
+  {
+    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
+  }
+#else
+  if (m_apcPicYuv[PIC_YUV_ORG    ]==NULL)
+  {
     m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
   }
@@ -197,4 +209,5 @@
     m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
   }
+#endif
 }
 
@@ -211,5 +224,19 @@
     const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
 
+#if SVC_EXTENSION
+    const Window& conformanceWindow    = sps.getConformanceWindow();
+
+    m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
+
+    for( Int i = 0; i < MAX_LAYERS; i++ )
+    {
+      if( m_requireResampling[i] )
+      {
+        m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
+      }
+    } 
+#else
     m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
+#endif
   }
 
@@ -464,7 +491,11 @@
   const Int  unitNum       = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 
 
-  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
-  {
-    TComDataCU* pcCUDes = getCtu(cuIdx);
+  for( UInt ctuRsAddr = 0; ctuRsAddr < m_picSym.getNumberOfCtusInFrame(); ctuRsAddr++ )  //each CTU
+  {
+    TComDataCU* pcCUDes = getCtu(ctuRsAddr);
+
+#if REDUCED_ENCODER_MEMORY
+    TComPicSym::DPBPerCtuData &dpbForCtu = m_picSym.getDPBPerCtuData(ctuRsAddr);
+#endif
 
     for(UInt absPartIdx = 0; absPartIdx < numPartitions; absPartIdx+=unitNum )  //each 16x16 unit
@@ -498,12 +529,28 @@
       }
 
+#if REDUCED_ENCODER_MEMORY
+      dpbForCtu.m_CUMvField[REF_PIC_LIST_0].setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(absPartIdx), absPartIdx);
+      dpbForCtu.m_CUMvField[REF_PIC_LIST_1].setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(absPartIdx), absPartIdx);
+#endif
+
       for(UInt i = 1; i < unitNum; i++ )  
       {
         pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(absPartIdx), absPartIdx + i);
         pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(absPartIdx), absPartIdx + i);
+
+#if REDUCED_ENCODER_MEMORY
+        dpbForCtu.m_CUMvField[REF_PIC_LIST_0].setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(absPartIdx), absPartIdx + i);
+        dpbForCtu.m_CUMvField[REF_PIC_LIST_1].setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(absPartIdx), absPartIdx + i);
+#endif
         pcCUDes->setPredictionMode(absPartIdx+i, pcCUDes->getPredictionMode(absPartIdx));
       }
     }
-    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(SChar)*numPartitions );
+    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(*pcCUDes->getPartitionSize())*numPartitions );
+
+#if REDUCED_ENCODER_MEMORY
+    memcpy( dpbForCtu.m_pePredMode, pcCUDes->getPredictionMode(), sizeof(*pcCUDes->getPredictionMode()) * numPartitions );
+    memcpy( dpbForCtu.m_pePartSize, pcCUDes->getPartitionSize(), sizeof(*pcCUDes->getPartitionSize()) * numPartitions );
+    dpbForCtu.m_pSlice = pcCUDes->getSlice();
+#endif
   }
 }
@@ -513,22 +560,34 @@
   const TComSPS *sps         = getSlice(0)->getSPS();
   const UInt uiMaxDepth      = sps->getMaxTotalCUDepth();
-  const UInt uiNumPartitions = 1<<(uiMaxDepth<<1);
-
-  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
-  {
-    TComDataCU* pcCUDes = getCtu(cuIdx);
+  const UInt numPartitions = 1<<(uiMaxDepth<<1);
+
+  for( UInt ctuRsAddr = 0; ctuRsAddr < m_picSym.getNumberOfCtusInFrame(); ctuRsAddr++ )  //each CTU
+  {
+    TComDataCU* pcCUDes = getCtu(ctuRsAddr);
     TComMvField zeroMvField;
-    for(UInt list = 0; list < 2; list++)  //each reference list
-    {
-      for(UInt i = 0; i < uiNumPartitions; i++ )  
-      {
-        pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, i);
-        pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, i);
-        pcCUDes->setPredictionMode(i, MODE_INTRA);
-        pcCUDes->setPartitionSize(i, SIZE_2Nx2N);
-      }
-    }
-  }
-  return;
+
+#if REDUCED_ENCODER_MEMORY
+    TComPicSym::DPBPerCtuData &dpbForCtu = m_picSym.getDPBPerCtuData(ctuRsAddr);
+#endif
+
+    for( UInt i = 0; i < numPartitions; i++ )  
+    {
+      pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, i);
+      pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, i);
+      pcCUDes->setPredictionMode(i, MODE_INTRA);
+      pcCUDes->setPartitionSize(i, SIZE_2Nx2N);
+
+#if REDUCED_ENCODER_MEMORY
+      dpbForCtu.m_CUMvField[REF_PIC_LIST_0].setMvField(zeroMvField, i);
+      dpbForCtu.m_CUMvField[REF_PIC_LIST_1].setMvField(zeroMvField, i);
+#endif
+    }
+
+#if REDUCED_ENCODER_MEMORY
+    memcpy( dpbForCtu.m_pePredMode, pcCUDes->getPredictionMode(), sizeof(*pcCUDes->getPredictionMode()) * numPartitions );
+    memcpy( dpbForCtu.m_pePartSize, pcCUDes->getPartitionSize(), sizeof(*pcCUDes->getPartitionSize()) * numPartitions );
+    dpbForCtu.m_pSlice = pcCUDes->getSlice();
+#endif
+  }
 }
 
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1577)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1578)
@@ -360,5 +360,5 @@
 
 #if SVC_EXTENSION
-  if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false )
+  if( m_ppcTDecTop[pcPic->getLayerId()]->m_isOutputLayerFlag == false )
   {
     pcPic->setOutputMark( false );
@@ -538,5 +538,5 @@
 
 #if REDUCED_ENCODER_MEMORY
-        pBLPic->create( pBLPic->getPicSym()->getSPS(), *pps, true, true, refLayerId);
+        pBLPic->create( pBLPic->getPicSym()->getSPS(), *pps, false, true, refLayerId);
 #else
         pBLPic->create( pBLPic->getPicSym()->getSPS(), *pps, true, refLayerId);
@@ -2298,5 +2298,5 @@
 
 #if REDUCED_ENCODER_MEMORY
-        m_cIlpPic[j]->create(*sps, *pps, true, true, m_layerId);
+        m_cIlpPic[j]->create(*sps, *pps, false, true, m_layerId);
 #else
         m_cIlpPic[j]->create(*sps, *pps, true, m_layerId);
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1577)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1578)
@@ -757,6 +757,7 @@
       }
 #if REDUCED_ENCODER_MEMORY
+      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, m_layerId);
 #else
-      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, m_layerId);
+      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
 #endif
 #else  //SVC_EXTENSION
@@ -1757,5 +1758,5 @@
         m_cIlpPic[j] = new TComPic;
 #if REDUCED_ENCODER_MEMORY
-        m_cIlpPic[j]->create(m_cSPS, m_cPPS, true, true, m_layerId);
+        m_cIlpPic[j]->create(m_cSPS, m_cPPS, false, true, m_layerId);
 #else
         m_cIlpPic[j]->create(m_cSPS, m_cPPS, true, m_layerId);
