Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1225)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1226)
@@ -4497,5 +4497,4 @@
   printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
   printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE);
-  printf("REF_IDX_MFM: %d ", REF_IDX_MFM);
 #else
   printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1225)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1226)
@@ -253,5 +253,4 @@
     m_acTEncTop[layer].setFramesToBeEncoded                               ( m_framesToBeEncoded );
 
-#if REF_IDX_MFM
 #if AVC_BASE
     m_acTEncTop[layer].setMFMEnabledFlag                                  (layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers());
@@ -259,5 +258,5 @@
     m_acTEncTop[layer].setMFMEnabledFlag                                  (layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) );
 #endif
-#endif
+
     // set layer ID
     m_acTEncTop[layer].setLayerId                                         ( m_acLayerCfg[layer].m_layerId );
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1226)
@@ -3416,5 +3416,4 @@
   Int iPelY = Clip3<Int>(0, m_pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - 1, pelY);
 
-#if REF_IDX_MFM
   // centre of the collocated 16x16 block for motion mapping
   if( motionMapping )
@@ -3423,5 +3422,4 @@
     iPelY = pelY + 8;
   }
-#endif
 
 #if !LAYER_CTB
@@ -3436,5 +3434,4 @@
   Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset();
 
-#if REF_IDX_MFM
   // offset for collocated block in the motion mapping
   if( motionMapping )
@@ -3453,5 +3450,4 @@
     }
   }
-#endif
 
   if ( iBX < 0 || iBX >= baseColPic->getPicYuvRec()->getWidth(COMPONENT_Y) || iBY < 0 || iBY >= baseColPic->getPicYuvRec()->getHeight(COMPONENT_Y) )
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1226)
@@ -155,5 +155,5 @@
   Void compress(Char* pePredMode, Int scale);
 
-#if REF_IDX_MFM
+#if SVC_EXTENSION
   Void setMvField( TComMvField const& mvField, Int iIdx )
   {
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1226)
@@ -277,5 +277,4 @@
 }
 
-#if REF_IDX_MFM
 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase)
 {
@@ -351,5 +350,4 @@
   return;
 }
-#endif
 
 Bool TComPic::checkSameRefInfo()
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPic.h	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPic.h	(revision 1226)
@@ -92,7 +92,5 @@
   Bool                  m_bSpatialEnhLayer[MAX_LAYERS];       // whether current layer is a spatial enhancement layer,
   TComPicYuv*           m_pcFullPelBaseRec[MAX_LAYERS];    // upsampled base layer recontruction for difference domain inter prediction
-#if REF_IDX_MFM
   Bool                  m_equalPictureSizeAndOffsetFlag[MAX_LAYERS]; 
-#endif
 #if CGS_3D_ASYMLUT
   Int                   m_nFrameBit;
@@ -203,13 +201,9 @@
   Void          setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
   TComPicYuv*   getFullPelBaseRec   (UInt refLayerIdc)  { return  m_pcFullPelBaseRec[refLayerIdc];  }
-#if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM
   Bool          isILR( UInt currLayerId )   { return ( m_bIsLongTerm && m_layerId < currLayerId ); }
-#endif
-#if REF_IDX_MFM
   Bool          equalPictureSizeAndOffsetFlag(UInt refLayerIdc)             { return m_equalPictureSizeAndOffsetFlag[refLayerIdc]; }
   Void          setEqualPictureSizeAndOffsetFlag(UInt refLayerIdc, Bool b)  { m_equalPictureSizeAndOffsetFlag[refLayerIdc] = b;    }
   Void          copyUpsampledMvField  ( UInt refLayerIdc, TComPic* pcPicBase );
   Void          initUpsampledMvField  ();
-#endif
   Bool          checkSameRefInfo();
   Void          copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut); 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1226)
@@ -120,8 +120,6 @@
 , m_firstSliceInPic               ( false )
 , m_availableForTMVPRefFlag       ( true )
-, m_layerId                     ( 0 )
-#if REF_IDX_MFM
+, m_layerId                       ( 0 )
 , m_bMFMEnabledFlag               ( false )
-#endif
 , m_bDiscardableFlag              ( false )
 , m_bCrossLayerBLAFlag            ( false )
@@ -3729,5 +3727,4 @@
       pcIlpPic[refLayerIdc]->getSlice(0)->setVPS( m_pcPic->getSlice(0)->getVPS() );
 
-#if REF_IDX_MFM
       if( m_bMFMEnabledFlag && !(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) )
       {
@@ -3776,5 +3773,4 @@
         pcIlpPic[refLayerIdc]->initUpsampledMvField();
       }
-#endif
 
       Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1( pcIlpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx() );
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1226)
@@ -1971,10 +1971,8 @@
   TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
   Int         m_numMotionPredRefLayers;
-#if REF_IDX_MFM
   Bool        m_bMFMEnabledFlag;
   Int         m_colRefLayerIdx;
   Bool        m_altColIndicationFlag;
   TComPic*    m_pcIlpPic;
-#endif
 
   Bool        m_interLayerPredEnabledFlag;
@@ -2271,8 +2269,7 @@
   Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
   Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
-#if REF_IDX_MFM
+
   Void      setMFMEnabledFlag(Bool flag)                { m_bMFMEnabledFlag = flag; }
   Bool      getMFMEnabledFlag()                         { return m_bMFMEnabledFlag; }
-#endif
 
   TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1226)
@@ -61,5 +61,4 @@
 #define ALIGNED_BUMPING                  1      ///< JCTVC-P0192: Align bumping of pictures in an AU
 
-#define REF_IDX_MFM                      1      ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture
 #define AUXILIARY_PICTURES               1      ///< JCTVC-O0041: auxiliary picture layers
 #define NO_CLRAS_OUTPUT_FLAG             1
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1226)
@@ -1745,5 +1745,5 @@
     if ( pcSlice->getEnableTMVPFlag() )
     {
-#if SVC_EXTENSION && REF_IDX_MFM
+#if SVC_EXTENSION
       // set motion mapping flag
       pcSlice->setMFMEnabledFlag( ( pcSlice->getNumMotionPredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() && !pcSlice->isIntra() ) ? true : false );
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1226)
@@ -1692,5 +1692,4 @@
       pcSlice->setILRPic( m_cIlpPic );
 
-#if REF_IDX_MFM
       pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
     }
@@ -1715,5 +1714,4 @@
       }
     }
-#endif
     
     if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag() && ( !pcSlice->getVPS()->getSingleLayerForNonIrapFlag() || pcSlice->isIRAP() ) )
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1226)
@@ -1782,12 +1782,7 @@
     {
       pcSlice->setILRPic( m_pcEncTop->getIlpList() );
-#if !REF_IDX_MFM
-      //  Set reference list
-      pcSlice->setRefPicList ( rcListPic );
-#endif
       pcSlice->setRefPicListModificationSvc();
       pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList());
 
-#if REF_IDX_MFM
       if( pcSlice->getMFMEnabledFlag() )
       {
@@ -1838,5 +1833,4 @@
         }
       }
-#endif
     }
 #else //SVC_EXTENSION
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1226)
@@ -80,8 +80,6 @@
 
 #if SVC_EXTENSION
-  memset(m_cIlpPic, 0, sizeof(m_cIlpPic));
-#if REF_IDX_MFM
+  memset( m_cIlpPic, 0, sizeof(m_cIlpPic) );
   m_bMFMEnabledFlag = false;
-#endif
   m_numRefLayerLocationOffsets = 0;
   m_pocAdjustmentValue     = 0;
@@ -623,5 +621,4 @@
           Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] );
 
-#if REF_IDX_MFM
           if( m_iSourceWidth == pcEncTopBase->getSourceWidth() && m_iSourceHeight == pcEncTopBase->getSourceHeight() && equalOffsets && zeroPhase )
           {
@@ -630,9 +627,4 @@
 
           if( !pcEPic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths 
-#else
-          if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 
-            || !equalOffsets
-            || !zeroPhase
-#endif
 #if CGS_3D_ASYMLUT
             || m_cPPS.getCGSFlag() > 0
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1225)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1226)
@@ -119,7 +119,5 @@
   TEncTop*                getLayerEnc(UInt layerIdx)       { return m_ppcTEncTop[layerIdx]; }
   TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture 
-#if REF_IDX_MFM
   Bool                    m_bMFMEnabledFlag;
-#endif
   UInt                    m_numRefLayerLocationOffsets;
   UInt                    m_refLocationOffsetLayerId[MAX_LAYERS];
@@ -233,8 +231,6 @@
 
   TComPic** getIlpList()                                      { return m_cIlpPic; }
-#if REF_IDX_MFM
   Void      setMFMEnabledFlag(Bool flag)                      { m_bMFMEnabledFlag = flag; }
   Bool      getMFMEnabledFlag()                               { return m_bMFMEnabledFlag; }    
-#endif
   Void      setInterLayerWeightedPredFlag(Bool flag)          { m_interLayerWeightedPredFlag = flag; }
   Bool      getInterLayerWeightedPredFlag()                   { return m_interLayerWeightedPredFlag; }
