Index: /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 377)
@@ -72,7 +72,5 @@
 , m_pRowHeight()
 , m_scalingListFile()
-#if REF_IDX_FRAMEWORK
 , m_elRapSliceBEnabled(0)
-#endif
 {
   for(UInt layer=0; layer<MAX_LAYERS; layer++)
@@ -514,11 +512,9 @@
 #endif
 #endif
-#if REF_IDX_FRAMEWORK
   ("EnableElRapB,-use-rap-b",  m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)")
-#endif  
 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
   ("IlSampleOnlyPred%d",       m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")
 #endif
-#else  
+#else
   ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
   ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
@@ -2239,11 +2235,8 @@
   printf("AvcBase:%d ", 0);
 #endif
-#if REF_IDX_FRAMEWORK
-  printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK);
   printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled);
   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);
-#endif
 #else
   printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
Index: /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 377)
@@ -59,5 +59,5 @@
   // file I/O
 #if SVC_EXTENSION
-  TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; 
+  TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS];
   Int       m_numLayers;                                      ///< number of layers
   Int       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask
@@ -340,5 +340,5 @@
   Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   Int       m_elRapSliceBEnabled;
 #endif
Index: /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 377)
@@ -475,7 +475,5 @@
     m_acTEncTop[layer].setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal );
     m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
-#if REF_IDX_FRAMEWORK
     m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled);
-#endif
 #if SCALED_REF_LAYER_OFFSETS
     if( layer > 0 )
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 377)
@@ -516,5 +516,5 @@
   UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if FAST_INTRA_SHVC
   Int           reduceSetOfIntraModes              (  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
@@ -538,5 +538,5 @@
   UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if SVC_COL_BLK 
   TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 );
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 377)
@@ -524,5 +524,5 @@
 }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 Void copyOnetoOnePicture(    // SVC_NONCOLL
                   Pel *in,        
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPic.h	(revision 377)
@@ -207,10 +207,10 @@
   const SEIMessages& getSEIs() const { return m_SEIs; }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   Void  copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut); 
-#endif
 #if AVC_SYNTAX
   Void readBLSyntax( fstream* filestream, UInt numBytes );
 #endif
+#endif
 #if SYNTAX_OUTPUT
   Void wrireBLSyntax( fstream* filestream, UInt numBytes );
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPicSym.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPicSym.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPicSym.cpp	(revision 377)
@@ -147,5 +147,5 @@
   m_apcTComDataCU = NULL;
 
-#if AVC_BASE || REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if( m_apcTComTile )
   {
@@ -156,5 +156,5 @@
   }
   delete [] m_apcTComTile;
-#if AVC_BASE || REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   }
 #endif
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 377)
@@ -118,5 +118,5 @@
   Int  getPredicBufHeight()       { return m_iYuvExtHeight; }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if SVC_UPSAMPLING
 #if SCALED_REF_LAYER_OFFSETS
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 377)
@@ -116,5 +116,4 @@
 #if SVC_EXTENSION
   memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) );
-#if REF_IDX_FRAMEWORK
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
   m_activeNumILRRefIdx        = 0; 
@@ -133,5 +132,4 @@
 #endif
 #endif
-#endif
 
   initEqualRef();
@@ -168,8 +166,4 @@
 #if SVC_EXTENSION
   m_layerId = layerId;
-#endif
-  m_aiNumRefIdx[0]      = 0;
-  m_aiNumRefIdx[1]      = 0;
-#if REF_IDX_FRAMEWORK
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
   m_activeNumILRRefIdx        = 0;
@@ -177,5 +171,5 @@
 #else
   m_numILRRefIdx              = 0;
-#endif  
+#endif
 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
   m_numSamplePredRefLayers       = 0;
@@ -183,4 +177,6 @@
 #endif
 #endif
+  m_aiNumRefIdx[0]      = 0;
+  m_aiNumRefIdx[1]      = 0;
   m_colFromL0Flag = 1;
   
@@ -384,5 +380,5 @@
   Int i;
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) )
   {
@@ -439,9 +435,9 @@
     pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));  
   }
-#if REF_IDX_FRAMEWORK
-  }
-#endif
-
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
+  }
+#endif
+
+#if SVC_EXTENSION
   for( i = 0; i < m_activeNumILRRefIdx; i++ )
   {
@@ -477,5 +473,5 @@
   TComPic*  rpsCurrList0[MAX_NUM_REF+1];
   TComPic*  rpsCurrList1[MAX_NUM_REF+1];
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if ILR_RESTR
   Int numInterLayerRPSPics = 0;
@@ -584,6 +580,6 @@
       rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
     }
+#if SVC_EXTENSION
 #if RPL_INIT_N0316_N0082
-#if REF_IDX_FRAMEWORK
     if( m_layerId > 0 )
     {
@@ -613,5 +609,5 @@
     }    
 #if !RPL_INIT_N0316_N0082
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
     if( m_layerId > 0 )
     {
@@ -650,5 +646,5 @@
     }    
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
     if( m_layerId > 0 )
     {
@@ -702,5 +698,5 @@
 }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 Void TComSlice::setRefPicListModificationSvc()
 {
@@ -832,5 +828,5 @@
   Int numRpsCurrTempList = 0;
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() && 
     (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
@@ -840,5 +836,5 @@
 #endif 
   {
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     return m_activeNumILRRefIdx;
@@ -857,5 +853,5 @@
     }
   }
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if( m_layerId > 0 )
   {
@@ -1080,6 +1076,4 @@
   m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
   memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
-#elif REF_IDX_FRAMEWORK
-  m_numILRRefIdx               = pSrc->m_numILRRefIdx;
 #endif
 #endif
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 377)
@@ -1404,5 +1404,5 @@
   Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
 #else
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   Int         m_numILRRefIdx;       //< for inter-layer reference picture ser
 #endif
@@ -1460,5 +1460,5 @@
   TComPic*    m_pcBaseColPic[MAX_LAYERS];
   TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
+#if M0457_COL_PICTURE_SIGNALING
   Int         m_numMotionPredRefLayers;
 #if REF_IDX_MFM
@@ -1761,5 +1761,4 @@
 #endif
 
-#if REF_IDX_FRAMEWORK
   Void      setRefPicListModificationSvc();
   Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
@@ -1789,5 +1788,5 @@
 #endif
 
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
+#if M0457_COL_PICTURE_SIGNALING
   Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
   Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
@@ -1806,12 +1805,4 @@
 #endif
 
-#else
-  // temporal solution for IntraBL. Only one reference layer is supported.
-  Int       getActiveNumILRRefIdx     ( )               { return  1; }
-  Int       getInterLayerPredLayerIdc (UInt layerIdx)   { return  m_layerId - 1;}
-  Void      setActiveNumILRRefIdx     ( Int i )         {}
-  Void      setInterLayerPredEnabledFlag( Bool   val )  {}
-#endif
-
 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 
 
Index: /branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 377)
@@ -93,6 +93,4 @@
 #define ILP_RAP                          1      ///< JCTVC-M0208 proposal 3
 
-#define REF_IDX_FRAMEWORK                1      ///< inter-layer reference framework
-
 #define IDR_ALIGNMENT                    1      ///< align IDR picures across layers 
 
@@ -102,5 +100,4 @@
 #endif
 
-#if REF_IDX_FRAMEWORK
 #define REF_IDX_ME_ZEROMV                1      ///< L0051: use zero motion for inter-layer reference picture (without fractional ME)
 #define ENCODER_FAST_MODE                1      ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
@@ -127,5 +124,4 @@
 #else
 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
-#endif
 #endif
 
Index: /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 377)
@@ -1414,5 +1414,5 @@
     }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     rpcSlice->setActiveNumILRRefIdx(0);
@@ -1637,5 +1637,5 @@
     if ( rpcSlice->getEnableTMVPFlag() )
     {
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
+#if M0457_COL_PICTURE_SIGNALING
 #if REMOVE_COL_PICTURE_SIGNALING
       rpcSlice->setMFMEnabledFlag( rpcSlice->getNumMotionPredRefLayers() > 0 ? true : false );
@@ -1680,5 +1680,5 @@
         rpcSlice->setColRefIdx(0);
       }
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
+#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
       }
 #endif
Index: /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 377)
@@ -247,5 +247,5 @@
     for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++)
     {
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS
       if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR( m_layerId ) )
Index: /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 377)
@@ -72,6 +72,4 @@
   m_pBLReconFile = NULL;
 #endif
-#endif
-#if REF_IDX_FRAMEWORK
   memset(m_cIlpPic, 0, sizeof(m_cIlpPic));
 #endif
@@ -108,5 +106,5 @@
   
   m_cSliceDecoder.destroy();
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   for(Int i=0; i<MAX_NUM_REF; i++)
   {
@@ -137,5 +135,5 @@
 }
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 Void TDecTop::xInitILRP(TComSPS *pcSPS)
 {
@@ -607,12 +605,11 @@
   m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId);
 
+#if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
   setRefLayerParams(m_apcSlicePilot->getVPS());
 #endif
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
+#if M0457_COL_PICTURE_SIGNALING
   m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers);
 #endif
-
-#if SVC_EXTENSION
 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
   m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() );
@@ -878,5 +875,5 @@
     pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic );
     // Set reference list
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
     if (m_layerId == 0)
 #endif
@@ -972,5 +969,4 @@
     }
 
-#if REF_IDX_FRAMEWORK
     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
     {
@@ -988,5 +984,4 @@
 #endif
       }
-#endif
       pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
     }
@@ -1103,5 +1098,5 @@
   m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
 #endif
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if(m_numLayer>0)
   {
Index: /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 377)
@@ -130,10 +130,8 @@
   Bool                    m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1];
 #endif
+  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
 #endif 
 #if AVC_SYNTAX || SYNTAX_OUTPUT
   fstream*               m_pBLSyntaxFile;
-#endif
-#if REF_IDX_FRAMEWORK
-  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture 
 #endif
 
@@ -209,12 +207,10 @@
   Int       getBLHeight() { return  m_iBLSourceHeight; }
 #endif
+  Void      xInitILRP(TComSPS *pcSPS);
+  Void      setILRPic(TComPic *pcPic);
 #endif
 #if AVC_SYNTAX || SYNTAX_OUTPUT
   Void      setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; }
   fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; }
-#endif
-#if REF_IDX_FRAMEWORK
-  Void      xInitILRP(TComSPS *pcSPS);
-  Void      setILRPic(TComPic *pcPic);
 #endif
 
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 377)
@@ -1231,5 +1231,5 @@
     if ( pcSlice->getEnableTMVPFlag() )
     {
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
+#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
       if ( !pcSlice->getIdrPicFlag() && pcSlice->getLayerId() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 && pcSlice->getNumMotionPredRefLayers() > 0 )
       {
@@ -1254,5 +1254,5 @@
         WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" );
       }
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
+#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
       }
 #endif
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 377)
@@ -363,10 +363,8 @@
   UInt      m_layerId;   
   UInt      m_numLayer;
-#endif 
-#if REF_IDX_FRAMEWORK
-  Int      m_elRapSliceBEnabled;
-#endif
+  Int       m_elRapSliceBEnabled;
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
-  Int      m_adaptiveResolutionChange;
+  Int       m_adaptiveResolutionChange;
+#endif
 #endif
 
@@ -868,13 +866,11 @@
   Void      setConformanceMode    (Int mode)     { m_conformanceMode = mode; }
   Void      setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; }
-#endif
-#if REF_IDX_FRAMEWORK
   Void      setElRapSliceTypeB(Int bEnabled) {m_elRapSliceBEnabled = bEnabled;}
   Int       getElRapSliceTypeB()              {return m_elRapSliceBEnabled;}
-#endif
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
   Void      setAdaptiveResolutionChange(Int x) { m_adaptiveResolutionChange = x;    }
   Int       getAdaptiveResolutionChange()      { return m_adaptiveResolutionChange; }
 #endif
+#endif
 };
 
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 377)
@@ -631,5 +631,5 @@
 #if SVC_UPSAMPLING
         if( pcPic->isSpatialEnhLayer(refLayerIdc))
-        { 
+        {
 #if SCALED_REF_LAYER_OFFSETS
           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
@@ -659,37 +659,34 @@
       }
 #endif
-
-    }
-#endif
-
-#if REF_IDX_FRAMEWORK
-    if( m_layerId > 0 && (pocCurr % m_pcCfg->getIntraPeriod() == 0) )
-    {
+      
+      if( pocCurr % m_pcCfg->getIntraPeriod() == 0 )
+      {
 #if IDR_ALIGNMENT
-      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic();
-      TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() );
-      if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
-      {
-        pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType());
-      }
-      else
-#endif
-      pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA);
-    }
-
-    if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
-    {
-      pcSlice->setSliceType(I_SLICE);
-    }
-    else if( m_layerId > 0 && !m_pcEncTop->getElRapSliceTypeB() )
-    {
-      if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
-          (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) &&
+        TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic();
+        TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() );
+        if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
+        {
+          pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType());
+        }
+        else
+#endif
+          pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA);
+      }
+      
+      if( pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
+      {
+        pcSlice->setSliceType(I_SLICE);
+      }
+      else if( !m_pcEncTop->getElRapSliceTypeB() )
+      {
+        if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
+           (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) &&
            pcSlice->getSliceType() == B_SLICE )
-      {
-        pcSlice->setSliceType(P_SLICE);
-      }
-    }
-#endif
+        {
+          pcSlice->setSliceType(P_SLICE);
+        }
+      }
+    }
+#endif //SVC_EXTENSION
     if(pcSlice->getTemporalLayerNonReferenceFlag())
     {
@@ -789,5 +786,5 @@
     pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
     {
@@ -827,5 +824,5 @@
 #endif
     }
-#endif
+#endif //SVC_EXTENSION
 
 #if ADAPTIVE_QP_SELECTION
@@ -833,5 +830,5 @@
 #endif      
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
     if ( pcSlice->getSliceType() == B_SLICE && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
@@ -842,33 +839,30 @@
       pcSlice->setColFromL0Flag(1-uiColDir);
     }
-#endif
 
     //  Set reference list
-#if REF_IDX_FRAMEWORK
     if(m_layerId ==  0 || ( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 ) )
     {
       pcSlice->setRefPicList( rcListPic);
     }
-#else
-    pcSlice->setRefPicList ( rcListPic );
-#endif
-#if REF_IDX_FRAMEWORK
+
     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
     {
       m_pcEncTop->setILRPic(pcPic);
-
 #if REF_IDX_MFM
 #if M0457_COL_PICTURE_SIGNALING
       if( pcSlice->getMFMEnabledFlag() )
 #else
-      if( pcSlice->getSPS()->getMFMEnabledFlag() )
-#endif
-      {
-        pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
+        if( pcSlice->getSPS()->getMFMEnabledFlag() )
+#endif
+        {
+          pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
-        pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
-#endif
-      }
-#endif
+          pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
+#endif
+        }
+#else
+    //  Set reference list
+    pcSlice->setRefPicList ( rcListPic );
+#endif //SVC_EXTENSION
       pcSlice->setRefPicListModificationSvc();
       pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList());
@@ -934,5 +928,5 @@
 #endif
     {
-#if !REF_IDX_FRAMEWORK
+#if !SVC_EXTENSION
       pcSlice->setColFromL0Flag(1-uiColDir);
 #endif
@@ -1649,5 +1643,5 @@
             startCUAddrSliceSegmentIdx++;
           }
-#if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
+#if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING
           pcSlice->setNumMotionPredRefLayers(m_pcEncTop->getNumMotionPredRefLayers());
 #endif
@@ -2655,5 +2649,5 @@
     for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++)
     {
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS
       if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) )
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 377)
@@ -400,5 +400,5 @@
   eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
   
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if(m_pcCfg->getLayerId() > 0)
   {
@@ -485,5 +485,5 @@
   xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
 
-#if SVC_EXTENSION && REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if( layerId > 0 )
   {
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 377)
@@ -83,7 +83,6 @@
   m_pcBitCounters          = NULL;
   m_pcRdCosts              = NULL;
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   memset(m_cIlpPic, 0, sizeof(m_cIlpPic));
-#endif
 #if REF_IDX_MFM
   m_bMFMEnabledFlag = false;
@@ -91,4 +90,5 @@
 #if SCALED_REF_LAYER_OFFSETS
   m_numScaledRefLayerOffsets = 0;
+#endif
 #endif
 }
@@ -288,9 +288,5 @@
   delete[] m_pcRdCosts;
   
-#if !SVC_EXTENSION
-  // destroy ROM
-  destroyROM();
-#endif
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   for(Int i=0; i<MAX_NUM_REF; i++)
   {
@@ -301,5 +297,8 @@
       m_cIlpPic[i] = NULL;
     }
-  }    
+  }
+#else
+  // destroy ROM
+  destroyROM();
 #endif
   return;
@@ -346,6 +345,4 @@
   m_iSPSIdCnt ++;
   m_iPPSIdCnt ++;
-#endif
-#if REF_IDX_FRAMEWORK
   xInitILRP();
 #endif
@@ -860,5 +857,5 @@
     }
   }
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   if (!m_layerId)
   {
@@ -869,6 +866,5 @@
     m_cPPS.setListsModificationPresentFlag(true);
   }
-#endif
-#if SVC_EXTENSION
+
   m_cPPS.setPPSId         ( m_iPPSIdCnt         );
   m_cPPS.setSPSId         ( m_iSPSIdCnt         );
@@ -1215,5 +1211,5 @@
 #endif
 
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
 Void TEncTop::xInitILRP()
 {
Index: /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 376)
+++ /branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 377)
@@ -132,8 +132,5 @@
   TEncTop**               m_ppcTEncTop;
   TEncTop*                getLayerEnc(UInt layer)   { return m_ppcTEncTop[layer]; }
-#endif
-#if REF_IDX_FRAMEWORK
   TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture 
-#endif
 #if REF_IDX_MFM
   Bool                    m_bMFMEnabledFlag;
@@ -145,4 +142,5 @@
   UInt                    m_numScaledRefLayerOffsets;
   Window                  m_scaledRefLayerWindow[MAX_LAYERS];
+#endif
 #endif
 protected:
@@ -153,5 +151,5 @@
   Void  xInitPPSforTiles  ();
   Void  xInitRPS          ();                             ///< initialize PPS from encoder options
-#if REF_IDX_FRAMEWORK
+#if SVC_EXTENSION
   Void xInitILRP();
 #endif
@@ -220,8 +218,6 @@
   /// encode several number of pictures until end-of-sequence
 #if SVC_EXTENSION
-#if REF_IDX_FRAMEWORK
   TComPic** getIlpList() { return m_cIlpPic; }
   Void      setILRPic(TComPic *pcPic);
-#endif
 #if REF_IDX_MFM
   Void      setMFMEnabledFlag       (Bool flag)   {m_bMFMEnabledFlag = flag;}
