Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 821)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 822)
@@ -3481,18 +3481,18 @@
 
 #if SVC_EXTENSION
-TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping )
+TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping )
 {
   UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
   UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
 
-  return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, iMotionMapping );
-}
-
-TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping )
+  return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, motionMapping );
+}
+
+TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping )
 {
   TComPic* baseColPic = m_pcSlice->getBaseColPic(refLayerIdc);
 
-  uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX);
-  uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY);
+  UInt uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth()  - 1, pelX + 8);
+  UInt uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, pelY + 8);
 
 #if !LAYER_CTB
@@ -3519,10 +3519,8 @@
 #if REF_IDX_MFM
   // offset for collocated block in the motion mapping
-  if( iMotionMapping == 1 )
-  {
-    Bool unequalPictureSizeFlag = g_posScalingFactor[refLayerIdc][0] != 65536 || g_posScalingFactor[refLayerIdc][1] != 65536; //the condition should be updated according to the WD.
-
+  if( motionMapping )
+  {
     // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check.
-    if( unequalPictureSizeFlag )
+    if( m_pcPic->isSpatialEnhLayer(refLayerIdc) )
     {
       iBX = ( ( iBX + 4 ) >> 4 ) << 4;
@@ -3531,6 +3529,7 @@
     else
     {
-      iBX += 4;
-      iBY += 4;
+      // copy motion field from the top left sample for 1x scaling ratio
+      iBX = pelX;
+      iBY = pelY;
     }
   }
@@ -3587,7 +3586,7 @@
 {
   // check BL mode
-  UInt          uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
+  UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
   // the right reference layerIdc should be specified, currently it is set to m_layerId-1
-  TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );
+  TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, false );
 
   if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 821)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 822)
@@ -469,6 +469,6 @@
   Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx);
 #endif
-  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 );
-  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 );
+  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false );
+  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false );
   Void          scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
 #endif
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 821)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 822)
@@ -260,8 +260,8 @@
 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase)
 {
-  UInt numPartitions   = 1<<(g_uiMaxCUDepth<<1);
-  UInt widthMinPU      = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
-  UInt heightMinPU     = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
-  Int  unitNum         = max (1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 
+  UInt numPartitions = 1<<(g_uiMaxCUDepth<<1);
+  UInt widthMinPU    = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
+  UInt heightMinPU   = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
+  Int  unitNum       = max (1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 
 
   for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++)  //each LCU
@@ -277,5 +277,5 @@
 
       TComDataCU *pcColCU = 0;
-      pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx, 1);
+      pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX, pelY, baseCUAddr, baseAbsPartIdx, true);
 
       if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
@@ -306,5 +306,5 @@
       }
     }
-    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(Char)*numPartitions);
+    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(Char)*numPartitions );
   }
 }
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 821)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 822)
@@ -185,5 +185,5 @@
       m_cIlpPic[i] = NULL;
     }
-  }    
+  }
 #endif
 }
@@ -1597,5 +1597,5 @@
 
 #if POC_RESET_IDC_DECODER
-  pcPic->setCurrAuFlag( true );
+    pcPic->setCurrAuFlag( true );
 #endif
 
