Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1295)
@@ -1084,6 +1084,4 @@
 
 
-Int TComSlice::m_prevTid0POC = 0;
-
 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
  * \param uiTLayer Temporal layer ID of the current slice
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1295)
@@ -1909,5 +1909,4 @@
   Int                        m_iAssociatedIRAP;
   NalUnitType                m_iAssociatedIRAPType;
-  static Int                 m_prevTid0POC; // TODO: Remove this static member variable.
   TComReferencePictureSet*   m_pcRPS;
   TComReferencePictureSet    m_LocalRPS;
@@ -2061,5 +2060,4 @@
   Void                        setRPSidx( Int iBDidx )                                { m_iBDidx = iBDidx;                                            }
   Int                         getRPSidx() const                                      { return m_iBDidx;                                              }
-  Int                         getPrevTid0POC() const                                 { return m_prevTid0POC;                                         }
   TComRefPicListModification* getRefPicListModification()                            { return &m_RefPicListModification;                             }
   Void                        setLastIDR(Int iIDRPOC)                                { m_iLastIDR = iIDRPOC;                                         }
@@ -2102,5 +2100,5 @@
   Bool                        isReferenced() const                                   { return m_bRefenced;                                           }
   Bool                        isReferenceNalu() const                                { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }
-  Void                        setPOC( Int i )                                        { m_iPOC              = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} }
+  Void                        setPOC( Int i )                                        { m_iPOC              = i; }
   Void                        setNalUnitType( NalUnitType e )                        { m_eNalUnitType      = e;                                      }
   NalUnitType                 getNalUnitType() const                                 { return m_eNalUnitType;                                        }
@@ -2135,5 +2133,4 @@
 
 #if SVC_EXTENSION
-  Void                        setPrevTid0POC( Int x )                                { m_prevTid0POC = x;                                            }
   Void                        setAssociatedIrapPocBeforeReset(Int x)                 { m_associatedIrapPocBeforeReset = x;                           }
   Int                         getAssociatedIrapPocBeforeReset(     )                 { return m_associatedIrapPocBeforeReset;                        }
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1295)
@@ -1168,5 +1168,5 @@
 }
 
-Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager)
+Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC)
 {
   UInt  uiCode;
@@ -1324,5 +1324,5 @@
       Int iPOClsb = uiCode;
 #endif
-      Int iPrevPOC = pcSlice->getPrevTid0POC();
+      Int iPrevPOC = prevTid0POC;
       Int iMaxPOClsb = 1<< sps->getBitsForPOC();
       Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1);
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1295)
@@ -85,5 +85,5 @@
   Void  parseProfileTier    (ProfileTierLevel *ptl, const Bool bIsSubLayer);
   Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
-  Void  parseSliceHeader    ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager);
+  Void  parseSliceHeader    ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC);
   Void  parseTerminatingBit ( UInt& ruiBit );
   Void  parseRemainingBytes ( Bool noTrailingBytesExpected );
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1295)
@@ -77,5 +77,5 @@
 #endif
 
-  virtual Void parseSliceHeader          ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager)       = 0;
+  virtual Void parseSliceHeader          ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC)       = 0;
 
   virtual Void parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
@@ -150,5 +150,5 @@
   Void    decodePPS                   ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); }
 #endif
-  Void    decodeSliceHeader           ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager);         }
+  Void    decodeSliceHeader           ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC)  { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager, prevTid0POC);         }
 
   Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h	(revision 1295)
@@ -79,11 +79,11 @@
   Void  parseVPS                  ( TComVPS* /*pcVPS*/ ) {}
   Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
-  Void  parsePPS                  ( TComPPS* /*pcPPS*/ 
 #if CGS_3D_ASYMLUT
-    , TCom3DAsymLUT * /*pc3DAsymLUT*/ , Int /*nLayerID*/
+  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TCom3DAsymLUT * /*pc3DAsymLUT*/, Int /*nLayerID*/ ) {}
+#else
+  Void  parsePPS                  ( TComPPS* /*pcPPS*/ ) {}
 #endif
-    ) {}
 
-  Void  parseSliceHeader          ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/) {}
+  Void  parseSliceHeader          ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/, const Int /*prevTid0POC*/) {}
   Void  parseTerminatingBit       ( UInt& ruiBit );
   Void  parseRemainingBytes       ( Bool noTrailingBytesExpected);
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1295)
@@ -82,4 +82,5 @@
   m_prevPOC                = MAX_INT;
 #endif
+  m_prevTid0POC            = 0;
   m_bFirstSliceInPicture    = true;
 #if !SVC_EXTENSION
@@ -399,4 +400,5 @@
   cFillPic->getSlice(0)->setReferenced(true);
   cFillPic->getSlice(0)->setPOC(iLostPoc);
+  xUpdatePreviousTid0POC(cFillPic->getSlice(0));
   cFillPic->setReconMark(true);
   cFillPic->setOutputMark(true);
@@ -749,5 +751,5 @@
 #endif
 
-  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager);
+  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager, m_prevTid0POC);
 
 #if SVC_EXTENSION
@@ -841,7 +843,9 @@
     Int iMaxPOClsb = 1 << sps->getBitsForPOC();
     m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
+    xUpdatePreviousTid0POC(m_apcSlicePilot);
   }
 
   // Skip pictures due to random access
+
   if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
   {
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1294)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1295)
@@ -106,4 +106,5 @@
   Int                     m_prevPOC;
 #endif
+  Int                     m_prevTid0POC;
   Bool                    m_bFirstSliceInPicture;
 #if !SVC_EXTENSION
@@ -284,4 +285,6 @@
 #endif
   Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
+  Void      xUpdatePreviousTid0POC( TComSlice *pSlice ) { if ((pSlice->getTLayer()==0) && (pSlice->isReferenceNalu() && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) { m_prevTid0POC=pSlice->getPOC(); } }
+
 
 #if SVC_EXTENSION
