Index: branches/SHM-1.0-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 27)
@@ -597,42 +597,5 @@
 };
 
-#if REF_IDX_MFM
-class TComUpsampledMvFieldCU
-{
-  TComCUMvField m_acCUMvField[2];  //array of motion vector field
-  UInt          m_uiCUAddr;
-  UInt          m_uiCUPelX;
-  UInt          m_uiCUPelY;
-
-public:
-  Void          createMvField(Int CUAddr, Int uiWidthInCU, UInt uiNumPartitions) 
-  { 
-    m_uiCUAddr      = CUAddr;
-    m_uiCUPelX      = (CUAddr % uiWidthInCU) * g_uiMaxCUWidth;
-    m_uiCUPelY      = (CUAddr / uiWidthInCU) * g_uiMaxCUWidth;
-
-    m_acCUMvField[0].create( uiNumPartitions ); 
-		m_acCUMvField[1].create( uiNumPartitions );
-    return; 
-  }
-
-  Void          initMvField() 
-  { 
-    m_acCUMvField[0].clearMvField(); 
-    m_acCUMvField[1].clearMvField(); 
-    return; 
-  }
-  Void          destroy() 
-  { 
-    m_acCUMvField[0].destroy(); 
-    m_acCUMvField[1].destroy(); 
-    return; 
-  }
-  TComCUMvField* getCUMvField         ( RefPicList e )          { return  &m_acCUMvField[e]; }
-  UInt           getAddr              ()                        { return  m_uiCUAddr;}
-  UInt           getCUPelX            ()                        { return  m_uiCUPelX; }
-  UInt           getCUPelY            ()                        { return  m_uiCUPelY; }
-};
-#endif
+
 
 namespace RasterAddress
Index: branches/SHM-1.0-dev/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 27)
@@ -160,5 +160,4 @@
 
 #if REF_IDX_MFM
-  UInt    getNumPartition()    { return m_uiNumPartition; }        
   Void    setMvField( TComMvField const  & mvField, Int iIdx)
   {
Index: branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 27)
@@ -71,10 +71,5 @@
 , m_bIsILR                                (false)
 #endif
-#if REF_IDX_MFM
-, m_bIsUpsampledMvField                   (false) 
-, m_apcTComUpsampledMvFieldCU             (NULL)
-, m_peUpsampledPredMode                   (NULL)
-, m_iNumCUInUpsampledPic                  (-1)
-#endif
+
 #endif
 {
@@ -562,32 +557,10 @@
 
 #if REF_IDX_MFM
-Void TComPic::createUpSampledMvField(Int upSampledHeight, Int upSampledWidth, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
-{
-	UInt uiNumPartitions   = 1<<(uiMaxDepth<<1);
-	UInt uiWidthInCU       = ( upSampledWidth % uiMaxWidth  ) ? upSampledWidth /uiMaxWidth  + 1 : upSampledWidth /uiMaxWidth;
-  UInt uiHeightInCU      = ( upSampledHeight% uiMaxHeight ) ? upSampledHeight/uiMaxHeight + 1 : upSampledHeight/uiMaxHeight;
-	UInt uiNumCUsInFrame   = uiWidthInCU * uiHeightInCU;
-	m_iNumCUInUpsampledPic = uiNumCUsInFrame;
-
-	m_apcTComUpsampledMvFieldCU     = new TComUpsampledMvFieldCU*[uiNumCUsInFrame];
-	m_peUpsampledPredMode           = new char*[uiNumCUsInFrame];
-
-	for (Int i = 0; i < uiNumCUsInFrame; i++ )
-	{
-		m_apcTComUpsampledMvFieldCU[i] = new TComUpsampledMvFieldCU;
-		m_apcTComUpsampledMvFieldCU[i]->createMvField(i, uiWidthInCU, uiNumPartitions);  //create Mv field
-		m_apcTComUpsampledMvFieldCU[i]->initMvField();                                   //initialize Mv field
-
-	  m_peUpsampledPredMode[i]     = new char[uiNumPartitions];
-	}
-
-	return;
-}
-
-Void TComPic::deriveUnitIdxBase(UInt uiUpsamplePelX, UInt uiUpsamplePelY, float ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx)
+Void TComPic::deriveUnitIdxBase( UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx )
 {
   //pixel in the base layer
-  UInt uiPelX       = (UInt)((float)uiUpsamplePelX/ratio);
-  UInt uiPelY       = (UInt)((float)uiUpsamplePelY/ratio);
+
+  UInt uiPelX       = (uiUpsamplePelX<<1)/ratio;
+  UInt uiPelY       = (uiUpsamplePelY<<1)/ratio;
   UInt uiBaseWidth  = getPicYuvRec()->getWidth();
   UInt uiBaseHeight = getPicYuvRec()->getHeight();
@@ -614,103 +587,89 @@
 
 
-//MV field up-sampling
-Void TComPic::doTheUpSampleMvField(UInt upSampleRatio)
-{
-  UInt uiWidthMinPU      = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
-  UInt uiHeightMinPU     = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
-  UInt uiNumPartitions   = 1<<(g_uiMaxCUDepth<<1);
-  UInt uiPelX, uiPelY;
-  UInt uiBaseCUAddr, uiBaseAbsPartIdx;
-  float ratio = 0;
-
-  //????????????????????????????
-  if(upSampleRatio == 0)       //ONE_TO_ONE
-    ratio = 1.0;
-  else if(upSampleRatio == 1)  //ONE_TO_TWO
-    ratio = 2.0;
-  else if(upSampleRatio == 2)  //TWO_TO_THREE
-    ratio = 1.5;
-
-  for(UInt uiCUAddr = 0; uiCUAddr < m_iNumCUInUpsampledPic; uiCUAddr++)  //each LCU
-  {
-    TComUpsampledMvFieldCU*& pcMvFieldCU = getUpsampledMvFieldCU(uiCUAddr);
-    pcMvFieldCU->initMvField();                                          //MV field initialization
-
-    Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) ); 
-    for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx+=unitNum )  //each 16x16 unit
-    {
-      //pixel position of each unit in up-sampled layer
-      uiPelX = pcMvFieldCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
-      uiPelY = pcMvFieldCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
-
-      //????????????????????????????
-      deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, ratio, uiBaseCUAddr, uiBaseAbsPartIdx);
-      if( (getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
-      {
-        for(UInt list = 0; list < 2; list++)  //each list
-        { 
-          TComMv cMv = getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getMv(uiBaseAbsPartIdx);
-          Int refIdx = getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getRefIdx(uiBaseAbsPartIdx);
-        //????????????????????????????
-        Int Hor = (Short) (ratio * cMv.getHor());
-        Int Ver = (Short) (ratio * cMv.getVer());
-
-        TComMv cScaledMv(Hor, Ver);
-        TComMvField sMvField;
-        sMvField.setMvField(cScaledMv, refIdx);
-
-        pcMvFieldCU->getCUMvField((RefPicList)list)->setMvField(sMvField, uiAbsPartIdx);
-        m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx] = MODE_INTER;
-        }
-      }
-      else
-      {
-        TComMvField zeroMvField;  //zero MV and invalid reference index
-        pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, uiAbsPartIdx);
-        pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, uiAbsPartIdx);
-
-    	  m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx]     = MODE_INTRA;
-      }
-
-      //MV compression
-      for(UInt i = 1; i < unitNum; i++ )  
-      {
-        pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->setMvField(pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->getMv(uiAbsPartIdx), pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i);
-        pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->setMvField(pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->getMv(uiAbsPartIdx), pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i);
-    	  m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx+i]     = m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx];
-      }
-
-    }  //ending for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx++) 
-  }  //ending for(UInt uiCUAddr = 0; uiCUAddr < m_iNumCUInUpsampledPic; uiCUAddr++)
-  return;
-}
+
 
 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase)
 {
-  assert( getPicSym()->getNumberOfCUsInFrame() == pcPicBase->getNumCUInUpsampledPic() );
-
-  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++)  //each LCU
-  {
-    UInt uiNumPartitions   = 1<<(g_uiMaxCUDepth<<1);
-
-    TComDataCU*             pcCUDes = getCU(cuIdx);
-    TComUpsampledMvFieldCU* pcMvFieldCU = pcPicBase->getUpsampledMvFieldCU(cuIdx);
-    for(UInt list = 0; list < 2; list++)  //each reference list
-    {
-      TComCUMvField* pcCUMvFieldDes = pcCUDes->getCUMvField((RefPicList)list);
-      TComCUMvField* pcCUMvFieldOrg = pcMvFieldCU->getCUMvField((RefPicList)list);
-
-      assert(pcCUMvFieldDes->getNumPartition() == pcCUMvFieldOrg->getNumPartition());
-      assert(pcCUMvFieldDes->getNumPartition() == uiNumPartitions);
-
-      pcCUMvFieldDes->clearMvField();
-      pcCUMvFieldDes->copyFrom(pcCUMvFieldOrg, pcCUMvFieldDes->getNumPartition(), 0);      
-    }
-
-    char* pPredModeSrc = pcPicBase->getUpsampledPreModeCU(cuIdx);
-    char* pPredModeDst = pcCUDes->getPredictionMode();
-    memcpy(pPredModeDst, pPredModeSrc, sizeof(char)*uiNumPartitions);
-    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(char)*uiNumPartitions);
-  }
+
+
+
+	Int iBWidth   = pcPicBase->getPicYuvRec()->getWidth () - pcPicBase->getPicYuvRec()->getPicCropLeftOffset() - pcPicBase->getPicYuvRec()->getPicCropRightOffset();
+	Int iBHeight  = pcPicBase->getPicYuvRec()->getHeight() - pcPicBase->getPicYuvRec()->getPicCropTopOffset() - pcPicBase->getPicYuvRec()->getPicCropBottomOffset();
+
+	Int iEWidth   = getPicYuvRec()->getWidth() -  getPicYuvRec()->getPicCropLeftOffset() - getPicYuvRec()->getPicCropRightOffset();
+	Int iEHeight  = getPicYuvRec()->getHeight() - getPicYuvRec()->getPicCropTopOffset() -  getPicYuvRec()->getPicCropBottomOffset();
+
+
+	UInt upSampleRatio = 0;
+	if(iEWidth == iBWidth && iEHeight == iBHeight)
+	{
+		upSampleRatio = 2;
+	}
+	else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight)
+	{
+		upSampleRatio = 3;
+	}
+	else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight)
+	{
+		upSampleRatio = 4;
+	}
+	else
+	{
+		assert(0);
+	}
+
+	for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++)  //each LCU
+	{
+		UInt uiNumPartitions   = 1<<(g_uiMaxCUDepth<<1);
+
+		TComDataCU*             pcCUDes = getCU(cuIdx);
+
+		UInt uiWidthMinPU      = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
+		UInt uiHeightMinPU     = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
+		Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) ); 
+
+		for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx+=unitNum )  //each 16x16 unit
+		{
+			//pixel position of each unit in up-sampled layer
+			UInt	uiPelX = pcCUDes->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
+			UInt	uiPelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
+			UInt uiBaseCUAddr, uiBaseAbsPartIdx;
+     		pcPicBase->deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, upSampleRatio, uiBaseCUAddr, uiBaseAbsPartIdx);
+			if( (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
+			{
+				for(UInt list = 0; list < 2; list++)  //each list
+				{ 
+					TComMv cMv = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getMv(uiBaseAbsPartIdx);
+					Int refIdx = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getRefIdx(uiBaseAbsPartIdx);
+
+					Int Hor =  ((Int)upSampleRatio * cMv.getHor())/2 ;
+					Int Ver =  ((Int)upSampleRatio * cMv.getVer())/2 ;
+
+					TComMv cScaledMv(Hor, Ver);
+					TComMvField sMvField;
+					sMvField.setMvField(cScaledMv, refIdx);
+
+					pcCUDes->getCUMvField((RefPicList)list)->setMvField(sMvField, uiAbsPartIdx);
+					pcCUDes->setPredictionMode(uiAbsPartIdx, MODE_INTER);
+				}
+			}
+
+			else
+			{
+				TComMvField zeroMvField;  //zero MV and invalid reference index
+				pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, uiAbsPartIdx);
+				pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, uiAbsPartIdx);
+				pcCUDes->setPredictionMode(uiAbsPartIdx, MODE_INTRA);
+			}
+
+			for(UInt i = 1; i < unitNum; i++ )  
+			{
+				pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(uiAbsPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i);
+				pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(uiAbsPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i);
+				pcCUDes->setPredictionMode(uiAbsPartIdx+i, pcCUDes->getPredictionMode(uiAbsPartIdx))  ;
+			}
+		}
+			memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(char)*uiNumPartitions);
+	}
 }
 #endif
Index: branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.h	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.h	(revision 27)
@@ -91,10 +91,4 @@
   Bool                  m_bIsILR;                 //  Is ILR picture
 #endif
-#if REF_IDX_MFM
-  Bool                          m_bIsUpsampledMvField;
-  TComUpsampledMvFieldCU**      m_apcTComUpsampledMvFieldCU;
-  Char**                        m_peUpsampledPredMode;
-  Int                           m_iNumCUInUpsampledPic;
-#endif
 #endif
 
@@ -128,24 +122,8 @@
   Bool          getIsILR()                  {return m_bIsILR;}
 #endif
+
 #if REF_IDX_MFM
-  Bool          IsUpsampledMvField()                         { return m_bIsUpsampledMvField; }
-  Void          setUpsampledMvField(Bool isUpsampledMvField) { m_bIsUpsampledMvField = isUpsampledMvField; }
-  Bool          upsampledMvFieldIsNull()      
-                {
-                  if (m_apcTComUpsampledMvFieldCU == NULL) 
-                    return true; 
-                  else 
-                    return false; 
-                }
-  Void          createUpSampledMvField(  Int upSampledHeight, Int upSampledWidth, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
-  Void          doTheUpSampleMvField  (  UInt upSampleRatio );
   Void          copyUpsampledMvField  (  TComPic* pcPicBase );
-  Void deriveUnitIdxBase(UInt uiUpsamplePelX, UInt uiUpsamplePelY, float ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx);
-
-  Int           getNumCUInUpsampledPic()       { return m_iNumCUInUpsampledPic; }
-  TComUpsampledMvFieldCU*&  getUpsampledMvFieldCU( UInt uiCUAddr )  { return m_apcTComUpsampledMvFieldCU[uiCUAddr]; }
-  char*  getUpsampledPreModeCU( UInt uiCUAddr )  { return m_peUpsampledPredMode[uiCUAddr]; }
-
-
+  Void          deriveUnitIdxBase     (  UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx );
 #endif
 
Index: branches/SHM-1.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 27)
@@ -521,7 +521,6 @@
 #if REF_IDX_MFM
     assert(iRefPicNum == 1);
-    if(getPOC() != 0)
+    if( getPOC() != 0 )
     { 
-      assert(getBaseColPic()->IsUpsampledMvField() == true); 
       pIlpPicList[0]->copyUpsampledMvField(getBaseColPic());
     }
@@ -556,5 +555,5 @@
 
 #if REF_IDX_MFM
-Void TComSlice::setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL)
+Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL )
 {
   //set reference picture POC of each ILP reference 
@@ -578,17 +577,22 @@
   ilpPic[0]->getSlice(0)->setNumRefIdx(REF_PIC_LIST_1, pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1));
   assert(ilpPic[0]->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1) <= MAX_NUM_REF);
-  
+
   for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 
-    ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 
-
+  {
+	  ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 
+  }
   for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 
-    ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx);
-
+  {
+	  ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx);
+  }
   for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 
-    ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 
-
+  {
+	  ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 
+  }
   for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 
-    ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 
-return;
+  {
+	  ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 
+  }
+  return;
 }
 #endif
Index: branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 27)
@@ -288,37 +288,4 @@
   rpcPic->compressMotion(); 
 
-#if REF_IDX_MFM
-  if( rpcPic->getLayerId() == 0 && rpcPic->upsampledMvFieldIsNull() ) 
-  { 
-    TComSPS *spsEL = m_ppcTDecTop[1]->getSPS();
-
-    rpcPic->createUpSampledMvField(spsEL->getPicHeightInLumaSamples(), spsEL->getPicWidthInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);  //create up-sampled mv field 
-  }
-
-  if( rpcPic->getLayerId() == 0 && rpcPic->IsUpsampledMvField() == false ) 
-  { 
-    TComSPS *spsBL = m_ppcTDecTop[0]->getSPS();
-    TComSPS *spsEL = m_ppcTDecTop[1]->getSPS();
-
-    Int iBWidth  = spsBL->getPicWidthInLumaSamples() - spsBL->getPicCropLeftOffset() - spsBL->getPicCropRightOffset(); 
-    Int iBHeight = spsBL->getPicHeightInLumaSamples() - spsBL->getPicCropTopOffset() - spsBL->getPicCropBottomOffset();
-
-    Int iEWidth  = spsEL->getPicWidthInLumaSamples() - spsEL->getPicCropLeftOffset() - spsEL->getPicCropRightOffset(); 
-    Int iEHeight = spsEL->getPicHeightInLumaSamples() - spsEL->getPicCropTopOffset() - spsEL->getPicCropBottomOffset();
-
-    UInt upSampleRatio; 
-    if(iEWidth == iBWidth && iEHeight == iBHeight) 
-      upSampleRatio = 0; 
-    else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight) 
-      upSampleRatio = 1; 
-    else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight) 
-      upSampleRatio = 2; 
-    else 
-      assert(0);
-
-    rpcPic->doTheUpSampleMvField(upSampleRatio); 
-    rpcPic->setUpsampledMvField(true);
-  }
-#endif
 
   Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
Index: branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 27)
@@ -271,7 +271,5 @@
 #endif
 
-#if REF_IDX_MFM
-    rpcPic->setUpsampledMvField(false);
-#endif
+
     m_cListPic.pushBack( rpcPic );
     
@@ -321,7 +319,5 @@
 #endif
 
-#if REF_IDX_MFM
-  rpcPic->setUpsampledMvField(false);
-#endif
+
 }
 
Index: branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 27)
@@ -1561,34 +1561,4 @@
 
       pcPic->compressMotion(); 
-#if REF_IDX_MFM
-      if( m_layerId == 0 && pcPic->upsampledMvFieldIsNull() )
-      {
-        Int     iEHeight     = m_ppcTEncTop[m_layerId+1]->getSourceHeight();
-        Int     iEWidth      = m_ppcTEncTop[m_layerId+1]->getSourceWidth();
-        pcPic->createUpSampledMvField(iEHeight, iEWidth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);  //create up-sampled mv field
-      }
-
-    	if( m_layerId == 0 && pcPic->IsUpsampledMvField() == false )
-      {
-        Int iBWidth  = m_ppcTEncTop[m_layerId]->getSourceWidth() - m_ppcTEncTop[m_layerId]->getCropLeft() - m_ppcTEncTop[m_layerId]->getCropRight();
-        Int iBHeight = m_ppcTEncTop[m_layerId]->getSourceHeight() - m_ppcTEncTop[m_layerId]->getCropTop() - m_ppcTEncTop[m_layerId]->getCropBottom();
-
-        Int iEWidth  = m_ppcTEncTop[m_layerId+1]->getSourceWidth() - m_ppcTEncTop[m_layerId+1]->getCropLeft() - m_ppcTEncTop[m_layerId+1]->getCropRight();
-        Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight() - m_ppcTEncTop[m_layerId+1]->getCropTop() - m_ppcTEncTop[m_layerId+1]->getCropBottom();
-
-        UInt upSampleRatio;
-        if(iEWidth == iBWidth && iEHeight == iBHeight)
-          upSampleRatio = 0;
-        else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight)
-          upSampleRatio = 1;
-        else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight)
-          upSampleRatio = 2;
-        else
-          assert(0);
-
-        pcPic->doTheUpSampleMvField(upSampleRatio);
-        pcPic->setUpsampledMvField(true);
-      }
-#endif
       
       //-- For time output for each slice
Index: branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 26)
+++ branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 27)
@@ -602,7 +602,5 @@
   // mark it should be extended
   rpcPic->getPicYuvRec()->setBorderExtension(false);
-#if REF_IDX_MFM
-  rpcPic->setUpsampledMvField(false);
-#endif
+
 }
 
