Index: branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.cpp	(revision 1292)
@@ -95,5 +95,5 @@
 
     // Map the 64 CABAC states to their corresponding probability values
-    static Double aStateToProbLPS[] = {0.50000000, 0.47460857, 0.45050660, 0.42762859, 0.40591239, 0.38529900, 0.36573242, 0.34715948, 0.32952974, 0.31279528, 0.29691064, 0.28183267, 0.26752040, 0.25393496, 0.24103941, 0.22879875, 0.21717969, 0.20615069, 0.19568177, 0.18574449, 0.17631186, 0.16735824, 0.15885931, 0.15079198, 0.14313433, 0.13586556, 0.12896592, 0.12241667, 0.11620000, 0.11029903, 0.10469773, 0.09938088, 0.09433404, 0.08954349, 0.08499621, 0.08067986, 0.07658271, 0.07269362, 0.06900203, 0.06549791, 0.06217174, 0.05901448, 0.05601756, 0.05317283, 0.05047256, 0.04790942, 0.04547644, 0.04316702, 0.04097487, 0.03889405, 0.03691890, 0.03504406, 0.03326442, 0.03157516, 0.02997168, 0.02844963, 0.02700488, 0.02563349, 0.02433175, 0.02309612, 0.02192323, 0.02080991, 0.01975312, 0.01875000};
+    static const Double aStateToProbLPS[] = {0.50000000, 0.47460857, 0.45050660, 0.42762859, 0.40591239, 0.38529900, 0.36573242, 0.34715948, 0.32952974, 0.31279528, 0.29691064, 0.28183267, 0.26752040, 0.25393496, 0.24103941, 0.22879875, 0.21717969, 0.20615069, 0.19568177, 0.18574449, 0.17631186, 0.16735824, 0.15885931, 0.15079198, 0.14313433, 0.13586556, 0.12896592, 0.12241667, 0.11620000, 0.11029903, 0.10469773, 0.09938088, 0.09433404, 0.08954349, 0.08499621, 0.08067986, 0.07658271, 0.07269362, 0.06900203, 0.06549791, 0.06217174, 0.05901448, 0.05601756, 0.05317283, 0.05047256, 0.04790942, 0.04547644, 0.04316702, 0.04097487, 0.03889405, 0.03691890, 0.03504406, 0.03326442, 0.03157516, 0.02997168, 0.02844963, 0.02700488, 0.02563349, 0.02433175, 0.02309612, 0.02192323, 0.02080991, 0.01975312, 0.01875000};
 
     Double probLPS          = aStateToProbLPS[ m_contextModel[ n ].getState() ];
Index: branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h	(revision 1292)
@@ -104,5 +104,5 @@
 
   SCuboid *** m_pCuboid;
-  const static Int m_nVertexIdxOffset[4][3];
+  static const Int m_nVertexIdxOffset[4][3];
   std::vector<UInt> m_vRefLayerId;
 
Index: branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1292)
@@ -3463,8 +3463,4 @@
   }
 
-#if !LAYER_CTB
-  UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
-#endif
-
   Int leftStartL = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
   Int topStartL  = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
Index: branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1292)
@@ -110,5 +110,5 @@
 #if ADAPTIVE_QP_SELECTION
   TCoeff*        m_pcArlCoeff[MAX_NUM_COMPONENT];  // ARL coefficient buffer (0->Y, 1->Cb, 2->Cr)
-  static TCoeff* m_pcGlbArlCoeff[MAX_NUM_COMPONENT]; // global ARL buffer
+  static TCoeff* m_pcGlbArlCoeff[MAX_NUM_COMPONENT]; // global ARL buffer  // TODO: Remove this static member variable.
   Bool           m_ArlCoeffIsAliasedAllocation;  ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d
 #endif
Index: branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1292)
@@ -254,5 +254,5 @@
 UInt g_auiRasterToPelY  [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
 
-UInt g_auiPUOffset[NUMBER_OF_PART_SIZES] = { 0, 8, 4, 4, 2, 10, 1, 5};
+const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES] = { 0, 8, 4, 4, 2, 10, 1, 5};
 
 Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx )
@@ -319,10 +319,10 @@
 }
 
-Int g_quantScales[SCALING_LIST_REM_NUM] =
+const Int g_quantScales[SCALING_LIST_REM_NUM] =
 {
   26214,23302,20560,18396,16384,14564
 };
 
-Int g_invQuantScales[SCALING_LIST_REM_NUM] =
+const Int g_invQuantScales[SCALING_LIST_REM_NUM] =
 {
   40,45,51,57,64,72
@@ -628,5 +628,5 @@
 };
 
-Int g_quantTSDefault4x4[4*4] =
+const Int g_quantTSDefault4x4[4*4] =
 {
   16,16,16,16,
@@ -636,5 +636,5 @@
 };
 
-Int g_quantIntraDefault8x8[8*8] =
+const Int g_quantIntraDefault8x8[8*8] =
 {
   16,16,16,16,17,18,21,24,
@@ -648,5 +648,5 @@
 };
 
-Int g_quantInterDefault8x8[8*8] =
+const Int g_quantInterDefault8x8[8*8] =
 {
   16,16,16,16,17,18,20,24,
@@ -660,6 +660,6 @@
 };
 
-UInt g_scalingListSize   [SCALING_LIST_SIZE_NUM] = {16,64,256,1024};
-UInt g_scalingListSizeX  [SCALING_LIST_SIZE_NUM] = { 4, 8, 16,  32};
+const UInt g_scalingListSize   [SCALING_LIST_SIZE_NUM] = {16,64,256,1024};
+const UInt g_scalingListSizeX  [SCALING_LIST_SIZE_NUM] = { 4, 8, 16,  32};
 
 #if SVC_EXTENSION
@@ -717,8 +717,4 @@
 }
 #if LAYER_CTB
-UInt g_auiLayerMaxCUWidth[MAX_LAYERS];
-UInt g_auiLayerMaxCUHeight[MAX_LAYERS];
-UInt g_auiLayerMaxCUDepth[MAX_LAYERS];
-UInt g_auiLayerAddCUDepth[MAX_LAYERS];
 UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
 UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
Index: branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1292)
@@ -85,5 +85,5 @@
 Void         initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );
 
-extern       UInt g_auiPUOffset[NUMBER_OF_PART_SIZES];
+extern const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES];
 
 #define QUANT_SHIFT                14 // Q(4) = 2^14
@@ -100,6 +100,6 @@
 #define SHIFT_INV_2ND              12 // Shift after second inverse transform stage
 
-extern Int g_quantScales[SCALING_LIST_REM_NUM];             // Q(QP%6)
-extern Int g_invQuantScales[SCALING_LIST_REM_NUM];          // IQ(QP%6)
+extern const Int g_quantScales[SCALING_LIST_REM_NUM];             // Q(QP%6)
+extern const Int g_invQuantScales[SCALING_LIST_REM_NUM];          // IQ(QP%6)
 
 #if RExt__HIGH_PRECISION_FORWARD_TRANSFORM
@@ -207,11 +207,11 @@
 extern const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
 
-extern Int g_quantTSDefault4x4[4*4];
-extern Int g_quantIntraDefault8x8[8*8];
-extern Int g_quantInterDefault8x8[8*8];
-
-extern UInt g_scalingListSize [SCALING_LIST_SIZE_NUM];
-extern UInt g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
-extern UInt g_scalingListNum  [SCALING_LIST_SIZE_NUM];
+extern const Int g_quantTSDefault4x4[4*4];
+extern const Int g_quantIntraDefault8x8[8*8];
+extern const Int g_quantInterDefault8x8[8*8];
+
+extern const UInt g_scalingListSize [SCALING_LIST_SIZE_NUM];
+extern const UInt g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
+extern const UInt g_scalingListNum  [SCALING_LIST_SIZE_NUM];
 
 #if SVC_EXTENSION
@@ -224,8 +224,4 @@
 std::string NaluToStr( NalUnitType nalu );
 #if LAYER_CTB
-extern       UInt g_auiLayerMaxCUWidth[MAX_LAYERS];
-extern       UInt g_auiLayerMaxCUHeight[MAX_LAYERS];
-extern       UInt g_auiLayerMaxCUDepth[MAX_LAYERS];
-extern       UInt g_auiLayerAddCUDepth[MAX_LAYERS];
 extern       UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
 extern       UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
Index: branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1292)
@@ -2727,7 +2727,7 @@
  * \returns pointer of quantization matrix
  */
-Int* TComScalingList::getScalingListDefaultAddress(UInt sizeId, UInt listId)
-{
-  Int *src = 0;
+const Int* TComScalingList::getScalingListDefaultAddress(UInt sizeId, UInt listId)
+{
+  const Int *src = 0;
   switch(sizeId)
   {
Index: branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1292)
@@ -165,5 +165,5 @@
   UInt       getRefMatrixId(UInt sizeId, UInt listId) const                     { return m_refMatrixId[sizeId][listId];                      } //!< get reference matrix ID
 
-  Int*       getScalingListDefaultAddress(UInt sizeId, UInt listId);                                                                           //!< get default matrix coefficient
+  const Int* getScalingListDefaultAddress(UInt sizeId, UInt listId);                                                                           //!< get default matrix coefficient
   Void       processDefaultMatrix(UInt sizeId, UInt listId);
 
@@ -1909,5 +1909,5 @@
   Int                        m_iAssociatedIRAP;
   NalUnitType                m_iAssociatedIRAPType;
-  static Int                 m_prevTid0POC;
+  static Int                 m_prevTid0POC; // TODO: Remove this static member variable.
   TComReferencePictureSet*   m_pcRPS;
   TComReferencePictureSet    m_LocalRPS;
Index: branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp	(revision 1292)
@@ -267,5 +267,5 @@
   }
 
-  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
+  const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
 
   const Int shift_1st = (uiLog2TrSize +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange;
@@ -339,5 +339,5 @@
   }
 
-  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
+  const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
 
   const Int shift_1st = TRANSFORM_MATRIX_SHIFT + 1; //1 has been added to shift_1st at the expense of shift_2nd
@@ -864,5 +864,5 @@
 Void xTrMxN(Int bitDepth, TCoeff *block, TCoeff *coeff, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange)
 {
-  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
+  const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
 
   const Int shift_1st = ((g_aucConvertToBit[iWidth] + 2) +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange;
@@ -931,5 +931,5 @@
 Void xITrMxN(Int bitDepth, TCoeff *coeff, TCoeff *block, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange)
 {
-  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
+  const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
 
   Int shift_1st = TRANSFORM_MATRIX_SHIFT + 1; //1 has been added to shift_1st at the expense of shift_2nd
@@ -1847,6 +1847,6 @@
     }
 
-    static const TCoeff pelMin=(TCoeff) std::numeric_limits<Pel>::min();
-    static const TCoeff pelMax=(TCoeff) std::numeric_limits<Pel>::max();
+    const TCoeff pelMin=(TCoeff) std::numeric_limits<Pel>::min();
+    const TCoeff pelMax=(TCoeff) std::numeric_limits<Pel>::max();
     if (rdpcmMode == RDPCM_VER)
     {
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1292)
@@ -52,6 +52,4 @@
 #include <time.h>
 
-extern Bool g_md5_mismatch; ///< top level flag to signal when there is a decode problem
-
 #if CONFORMANCE_BITSTREAM_MODE
 Bool pocCompareFunction( const TComPic &pic1, const TComPic &pic2 )
@@ -63,5 +61,5 @@
 //! \ingroup TLibDecoder
 //! \{
-static Void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths);
+static Void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths, UInt &numChecksumErrors);
 // ====================================================================================================================
 // Constructor / destructor / initialization / destroy
@@ -69,4 +67,5 @@
 
 TDecGop::TDecGop()
+ : m_numberOfChecksumErrorsDetected(0)
 {
   m_dDecTime = 0;
@@ -114,5 +113,7 @@
   m_pcSliceDecoder        = pcSliceDecoder;
   m_pcLoopFilter          = pcLoopFilter;
-  m_pcSAO  = pcSAO;
+  m_pcSAO                 = pcSAO;
+  m_numberOfChecksumErrorsDetected = 0;
+
 #if SVC_EXTENSION   
   m_ppcTDecTop            = ppcDecTop;
@@ -247,7 +248,7 @@
     }
 #if SVC_EXTENSION
-    calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getBitDepths());
-#else
-    calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getSPS()->getBitDepths());
+    calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getBitDepths(), m_numberOfChecksumErrorsDetected);
+#else
+    calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getSPS()->getBitDepths(), m_numberOfChecksumErrorsDetected);
 #endif
   }
@@ -279,5 +280,5 @@
  *            unk         - no SEI message was available for comparison
  */
-static Void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths)
+static Void calcAndPrintHashStatus(TComPicYuv& pic, const SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths, UInt &numChecksumErrors)
 {
   /* calculate MD5sum for entire reconstructed picture */
@@ -334,5 +335,5 @@
   if (mismatch)
   {
-    g_md5_mismatch = true;
+    numChecksumErrors++;
     printf("[rx%s:%s] ", hashType, hashToString(pictureHashSEI->m_pictureHash, numChar).c_str());
   }
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.h	(revision 1292)
@@ -80,4 +80,5 @@
   Double                m_dDecTime;
   Int                   m_decodedPictureHashSEIEnabled;  ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
+  UInt                  m_numberOfChecksumErrorsDetected;
 
 #if SVC_EXTENSION
@@ -112,4 +113,6 @@
 
   Void setDecodedPictureHashSEIEnabled(Int enabled) { m_decodedPictureHashSEIEnabled = enabled; }
+  UInt getNumberOfChecksumErrorsDetected() const { return m_numberOfChecksumErrorsDetected; }
+
 #if SVC_EXTENSION
   TDecTop*   getLayerDec(UInt layerId)  { return m_ppcTDecTop[layerId]; }
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1292)
@@ -63,5 +63,6 @@
 
 TDecTop::TDecTop()
-  : m_pDecodedSEIOutputStream(NULL)
+  : m_pDecodedSEIOutputStream(NULL),
+    m_warningMessageSkipPicture(false)
 {
   m_pcPic = 0;
@@ -2167,9 +2168,8 @@
     else
     {
-      static Bool warningMessage = false;
-      if(!warningMessage)
+      if(!m_warningMessageSkipPicture)
       {
         printf("\nWarning: this is not a valid random access point and the data is discarded until the first CRA picture");
-        warningMessage = true;
+        m_warningMessageSkipPicture = true;
       }
       return true;
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1292)
@@ -121,4 +121,6 @@
   std::ostream           *m_pDecodedSEIOutputStream;
 
+  Bool                    m_warningMessageSkipPicture;
+
 #if SVC_EXTENSION
   Bool                    m_isLastNALWasEos;
@@ -191,4 +193,5 @@
   Void  deletePicBuffer();
 
+  
   Void  executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
   Void  checkNoOutputPriorPics (TComList<TComPic*>* rpcListPic);
@@ -203,4 +206,5 @@
 #endif
   Void  setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; }
+  UInt  getNumberOfChecksumErrorsDetected() const { return m_cGopDecoder.getNumberOfChecksumErrorsDetected(); }
 
 #if SVC_EXTENSION
@@ -259,9 +263,9 @@
 protected:
 #if SVC_EXTENSION
-  Void      xGetNewPicBuffer  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
+  Void  xGetNewPicBuffer  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
 #else
-  Void      xGetNewPicBuffer  (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
-#endif
-  Void      xCreateLostPicture (Int iLostPOC);
+  Void  xGetNewPicBuffer  (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
+#endif
+  Void  xCreateLostPicture (Int iLostPOC);
 
   Void      xActivateParameterSets();
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.cpp	(revision 1292)
@@ -45,17 +45,4 @@
 //////////////////////////////////////////////////////////////////////
 
-#if SVC_EXTENSION
-TEncAnalyze             m_gcAnalyzeAll [MAX_LAYERS];
-TEncAnalyze             m_gcAnalyzeI [MAX_LAYERS];
-TEncAnalyze             m_gcAnalyzeP [MAX_LAYERS];
-TEncAnalyze             m_gcAnalyzeB [MAX_LAYERS];
-#else
-TEncAnalyze             m_gcAnalyzeAll;
-TEncAnalyze             m_gcAnalyzeI;
-TEncAnalyze             m_gcAnalyzeP;
-TEncAnalyze             m_gcAnalyzeB;
-#endif
-
-TEncAnalyze             m_gcAnalyzeAll_in;
 
 //! \}
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1292)
@@ -137,5 +137,5 @@
 
 #if SVC_EXTENSION
-  Void    printOut ( Char cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths, UInt layer )
+  Void    printOut ( Char cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths, UInt layer = 0 )
 #else
   Void    printOut ( Char cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths )
@@ -451,15 +451,8 @@
 };
 
-#if SVC_EXTENSION
-extern TEncAnalyze             m_gcAnalyzeAll [MAX_LAYERS];
-extern TEncAnalyze             m_gcAnalyzeI [MAX_LAYERS];
-extern TEncAnalyze             m_gcAnalyzeP [MAX_LAYERS];
-extern TEncAnalyze             m_gcAnalyzeB [MAX_LAYERS];
-#else
 extern TEncAnalyze             m_gcAnalyzeAll;
 extern TEncAnalyze             m_gcAnalyzeI;
 extern TEncAnalyze             m_gcAnalyzeP;
 extern TEncAnalyze             m_gcAnalyzeB;
-#endif
 
 extern TEncAnalyze             m_gcAnalyzeAll_in;
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1292)
@@ -2918,5 +2918,4 @@
 }
 
-#if !SVC_EXTENSION
 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths)
 {
@@ -2971,5 +2970,4 @@
   printf("\nRVM: %.3lf\n" , xCalculateRVM());
 }
-#endif
 
 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, UInt64& ruiDist )
@@ -3267,20 +3265,4 @@
 
   //===== add PSNR =====
-#if SVC_EXTENSION
-  m_gcAnalyzeAll[pcPic->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId)].addResult (dPSNR, (Double)uibits, MSEyuvframe);
-  TComSlice*  pcSlice = pcPic->getSlice(0);
-  if (pcSlice->isIntra())
-  {
-    m_gcAnalyzeI[pcPic->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId)].addResult (dPSNR, (Double)uibits, MSEyuvframe);
-  }
-  if (pcSlice->isInterP())
-  {
-    m_gcAnalyzeP[pcPic->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId)].addResult (dPSNR, (Double)uibits, MSEyuvframe);
-  }
-  if (pcSlice->isInterB())
-  {
-    m_gcAnalyzeB[pcPic->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId)].addResult (dPSNR, (Double)uibits, MSEyuvframe);
-  }
-#else
   m_gcAnalyzeAll.addResult (dPSNR, (Double)uibits, MSEyuvframe);
   TComSlice*  pcSlice = pcPic->getSlice(0);
@@ -3297,5 +3279,4 @@
     m_gcAnalyzeB.addResult (dPSNR, (Double)uibits, MSEyuvframe);
   }
-#endif
 
   Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1292)
@@ -86,4 +86,11 @@
 
 private:
+
+  TEncAnalyze             m_gcAnalyzeAll;
+  TEncAnalyze             m_gcAnalyzeI;
+  TEncAnalyze             m_gcAnalyzeP;
+  TEncAnalyze             m_gcAnalyzeB;
+
+  TEncAnalyze             m_gcAnalyzeAll_in;
   //  Data
   Bool                    m_bLongtermTestPictureHasBeenCoded;
@@ -193,7 +200,5 @@
   TComList<TComPic*>*   getListPic()      { return m_pcListPic; }
   
-#if !SVC_EXTENSION
   Void  printOutSummary      ( UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths );
-#endif
   Void  preLoopFilterPicAll  ( TComPic* pcPic, UInt64& ruiDist );
 
@@ -204,9 +209,16 @@
 #if SVC_EXTENSION
   Void  determinePocResetIdc( Int const pocCurr, TComSlice *const slice);
-  Int   getIntraRefreshInterval()  { return m_pcCfg->getIntraPeriod(); }
-  Int   getIntraRefreshType()      { return m_pcCfg->getDecodingRefreshType(); }  
-  Int   getLastPocPeriodId()      { return m_lastPocPeriodId; }
-  Void  setLastPocPeriodId(Int x) { m_lastPocPeriodId = x;    }
+  Int   getIntraRefreshInterval()   { return m_pcCfg->getIntraPeriod(); }
+  Int   getIntraRefreshType()       { return m_pcCfg->getDecodingRefreshType(); }  
+  Int   getLastPocPeriodId()        { return m_lastPocPeriodId; }
+  Void  setLastPocPeriodId(Int x)   { m_lastPocPeriodId = x;    }
   Void  updatePocValuesOfPics( Int const pocCurr, TComSlice *const slice);
+
+  TEncAnalyze* getAnalyzeAll()      { return &m_gcAnalyzeAll;  }
+  TEncAnalyze* getAnalyzeI()        { return &m_gcAnalyzeI;    }
+  TEncAnalyze* getAnalyzeP()        { return &m_gcAnalyzeP;    }
+  TEncAnalyze* getAnalyzeB()        { return &m_gcAnalyzeB;    }
+  TEncAnalyze* getAnalyzeAllin()    { return &m_gcAnalyzeAll_in; }
+  Double       calculateRVM()       { return xCalculateRVM();    }
 #endif
 
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1291)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1292)
@@ -263,4 +263,11 @@
   Void      setCurrPocMsb(Int poc)                            { m_currPocMsb = poc;  }
   Int       getCurrPocMsb()                                   { return m_currPocMsb; }
+
+  TEncAnalyze* getAnalyzeAll()                                { return m_cGOPEncoder.getAnalyzeAll();   }
+  TEncAnalyze* getAnalyzeI()                                  { return m_cGOPEncoder.getAnalyzeI();     }
+  TEncAnalyze* getAnalyzeP()                                  { return m_cGOPEncoder.getAnalyzeP();     }
+  TEncAnalyze* getAnalyzeB()                                  { return m_cGOPEncoder.getAnalyzeB();     }
+  TEncAnalyze* getAnalyzeAllin()                              { return m_cGOPEncoder.getAnalyzeAllin(); }
+  Double       calculateRVM()                                 { return m_cGOPEncoder.calculateRVM();    }
 #else //SVC_EXTENSION
   Void encode( Bool bEos,
@@ -275,7 +282,7 @@
                TComList<TComPicYuv*>& rcListPicYuvRecOut,
                std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff);
+#endif //#if SVC_EXTENSION
 
   Void printSummary(Bool isField) { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded, isField, m_printMSEBasedSequencePSNR, m_printSequenceMSE, m_cSPS.getBitDepths()); }
-#endif //#if SVC_EXTENSION
 };
 
