Index: branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 333)
+++ branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 334)
@@ -584,4 +584,24 @@
       rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
     }
+#if RPL_INIT_N0316_N0082
+#if REF_IDX_FRAMEWORK
+    if( m_layerId > 0 )
+    {
+#if JCTVC_M0458_INTERLAYER_RPS_SIG
+      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)      
+#else
+      for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
+#endif 
+      {
+        Int refLayerIdc = m_interLayerPredLayerIdc[i];
+#if ILR_RESTR
+        Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
+        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
+#endif
+          rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
+      }
+    }
+#endif
+#endif 
     for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     {
@@ -592,5 +612,5 @@
       rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
     }    
-
+#if !RPL_INIT_N0316_N0082
 #if REF_IDX_FRAMEWORK
     if( m_layerId > 0 )
@@ -611,4 +631,5 @@
     }
 #endif
+#endif
   assert(cIdx == numPocTotalCurr);
 
@@ -692,4 +713,7 @@
   TComRefPicListModification* refPicListModification = &m_RefPicListModification;
   Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList();  // total number of ref pics in listTemp0 including inter-layer ref pics
+#if RPL_INIT_N0316_N0082
+  Int numberOfPocBeforeCurr = this->getNumNegativeRpsCurrTempList();  // number of negative temporal ref pics 
+#endif
 
   assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1);
@@ -697,5 +721,12 @@
 
   //set L0 inter-layer reference picture modification
+#if RPL_INIT_N0316_N0082
+  Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
+#else
   Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true;
+#endif
+#if FINAL_RPL_CHANGE_N0082
+  hasModification = false; //modification is not necessary
+#endif
   refPicListModification->setRefPicListModificationFlagL0(hasModification);
   if(hasModification)
@@ -721,5 +752,16 @@
 #endif 
       {
+#if RPL_INIT_N0316_N0082
+        if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0])
+          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
+        else
+        {
+          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
+          for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++)
+            refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx);
+        }
+#else
         refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i);
+#endif
       }
     }
@@ -758,5 +800,24 @@
 }
 #endif
-
+#if RPL_INIT_N0316_N0082
+Int TComSlice::getNumNegativeRpsCurrTempList()
+{
+  if( m_eSliceType == I_SLICE ) 
+  {
+    return 0;
+  }
+
+  Int numPocBeforeCurr = 0;
+  for( UInt i = 0; i < m_pcRPS->getNumberOfNegativePictures(); i++ )
+  {
+    if(m_pcRPS->getUsed(i))
+    {
+      numPocBeforeCurr++;
+    }
+  }
+
+  return numPocBeforeCurr;
+}
+#endif
 Int TComSlice::getNumRpsCurrTempList()
 {
Index: branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 333)
+++ branches/SHM-3.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 334)
@@ -1567,4 +1567,7 @@
   Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
   Int       getNumRpsCurrTempList();
+#if RPL_INIT_N0316_N0082
+  Int       getNumNegativeRpsCurrTempList();
+#endif
   Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
   Void      setReferenced(Bool b)                               { m_bRefenced = b; }
Index: branches/SHM-3.0-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-3.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 333)
+++ branches/SHM-3.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 334)
@@ -47,5 +47,6 @@
 #if SVC_EXTENSION
 #define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
-
+#define RPL_INIT_N0316_N0082             1      ///< N0316, N0082: initial reference picture list construction 
+#define FINAL_RPL_CHANGE_N0082           1      ///< N0082: final ref picture list change (encoder)
 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1      ///< VUI flag to indicate tile boundary alignment
 #define M0463_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
Index: branches/SHM-3.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-3.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 333)
+++ branches/SHM-3.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 334)
@@ -886,5 +886,9 @@
   for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) 
   {
+#if FINAL_RPL_CHANGE_N0082
+    GOPEntry ge = m_ppcTEncTop[m_cSPS.getLayerId()]->getGOPEntry(i);
+#else
     GOPEntry ge = getGOPEntry(i);
+#endif
     rps = rpsList->getReferencePictureSet(i);
     rps->setNumberOfPictures(ge.m_numRefPics);
