Changeset 655 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp


Ignore:
Timestamp:
23 Oct 2013, 23:01:30 (10 years ago)
Author:
tech
Message:

Merged 8.1-Cleanup@654

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r622 r655  
    101101, m_enableTMVPFlag                ( true )
    102102#if H_MV
    103 #if H_MV5
    104103, m_refPicSetInterLayer0           ( NULL )
    105104, m_refPicSetInterLayer1           ( NULL )
    106 #else
    107 , m_refPicSetInterLayer           ( NULL )
    108 #endif
    109105, m_layerId                       (0)
    110106, m_viewId                        (0)
    111 #if H_MV5
    112107, m_viewIndex                     (0)
    113 #endif
    114108#if H_3D
    115 #if !H_MV5
    116 , m_viewIndex                     (0)
    117 #endif
    118109, m_isDepth                       (false)
    119110#endif
    120 #if H_MV5
    121111, m_pocResetFlag                  (false)
    122 #endif
    123112, m_discardableFlag               (false)
    124113, m_interLayerPredEnabledFlag     (false)
    125114, m_numInterLayerRefPicsMinus1    (0)
    126 #if !H_MV5
    127 , m_interLayerSamplePredOnlyFlag  (false)
    128 , m_altCollocatedIndicationFlag   (0)
    129 , m_collocatedRefLayerIdx         (0)
    130 #endif
    131115#if H_3D_IC
    132116, m_bApplyIC                      ( false )
     
    164148  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    165149  {
    166 #if H_MV5
    167150   m_interLayerPredLayerIdc[ i ] = i;
    168 #else
    169    m_interLayerPredLayerIdc[ i ] = 0;
    170 #endif
    171151  }
    172152#endif
     
    322302  if (!pocHasMsb)
    323303  {
    324     poc = poc % pocCycle;
     304    poc = poc & (pocCycle - 1);
    325305  }
    326306 
     
    333313      if (!pocHasMsb)
    334314      {
    335         picPoc = picPoc % pocCycle;
     315        picPoc = picPoc & (pocCycle - 1);
    336316      }
    337317     
     
    387367  }
    388368}
    389 #if H_MV5
    390369#if !H_MV
    391370#if FIX1071
     
    472451  {
    473452    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    474     // “ If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    475     // “ Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     453    // ?If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     454    // ?Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    476455    if (getRapPicFlag())
    477456    {
     
    730709}
    731710#endif
    732 #else
     711Int TComSlice::getNumRpsCurrTempList()
     712{
     713  Int numRpsCurrTempList = 0;
     714
     715  if (m_eSliceType == I_SLICE)
     716  {
     717    return 0;
     718  }
     719  for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)
     720  {
     721    if(m_pcRPS->getUsed(i))
     722    {
     723      numRpsCurrTempList++;
     724    }
     725  }
    733726#if H_MV
    734 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
    735 #else
    736 #if FIX1071
    737 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
    738 #else
    739 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
    740 #endif
    741 #endif
    742 {
    743 #if FIX1071
    744   if (!checkNumPocTotalCurr)
    745 #endif
    746   {
    747     if (m_eSliceType == I_SLICE)
    748     {
    749       ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    750       ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    751      
    752       return;
    753     }
    754    
    755 #if !H_MV
    756     m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    757     m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    758 #endif
    759   }
    760 
    761   TComPic*  pcRefPic= NULL;
    762   TComPic*  RefPicSetStCurr0[16];
    763   TComPic*  RefPicSetStCurr1[16];
    764   TComPic*  RefPicSetLtCurr[16];
    765   UInt NumPocStCurr0 = 0;
    766   UInt NumPocStCurr1 = 0;
    767   UInt NumPocLtCurr = 0;
    768   Int i;
    769 
    770   for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
    771   {
    772     if(m_pcRPS->getUsed(i))
    773     {
    774       pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
    775       pcRefPic->setIsLongTerm(0);
    776       pcRefPic->getPicYuvRec()->extendPicBorder();
    777       RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;
    778       NumPocStCurr0++;
    779       pcRefPic->setCheckLTMSBPresent(false); 
    780     }
    781   }
    782  
    783   for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
    784   {
    785     if(m_pcRPS->getUsed(i))
    786     {
    787       pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
    788       pcRefPic->setIsLongTerm(0);
    789       pcRefPic->getPicYuvRec()->extendPicBorder();
    790       RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;
    791       NumPocStCurr1++;
    792       pcRefPic->setCheckLTMSBPresent(false); 
    793     }
    794   }
    795  
    796   for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
    797   {
    798     if(m_pcRPS->getUsed(i))
    799     {
    800       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    801       pcRefPic->setIsLongTerm(1);
    802       pcRefPic->getPicYuvRec()->extendPicBorder();
    803       RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
    804       NumPocLtCurr++;
    805     }
    806     if(pcRefPic==NULL)
    807     {
    808       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    809     }
    810     pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
    811   }
    812 
    813   // ref_pic_list_init
    814   TComPic*  rpsCurrList0[MAX_NUM_REF+1];
    815   TComPic*  rpsCurrList1[MAX_NUM_REF+1];
    816 #if H_MV
    817   Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    818   assert( numPocInterCurr == 0 || getInterRefEnabledInRPLFlag() );
    819   Int numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );
    820   assert( numPocTotalCurr == getNumRpsCurrTempList() );
    821 #else
    822   Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    823 #endif
    824 #if FIX1071
    825   if (checkNumPocTotalCurr)
    826   {
    827     // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    828 #if H_MV
    829     // – If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    830     // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    831     if ( getRapPicFlag() && m_layerId == 0 )
    832 #else
    833     // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    834     // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    835     if (getRapPicFlag())
    836 #endif
    837     {
    838       assert(numPocTotalCurr == 0);
    839     }
    840 
    841     if (m_eSliceType == I_SLICE)
    842     {
    843       ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    844       ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    845      
    846       return;
    847     }
    848    
    849     assert(numPocTotalCurr > 0);
    850    
    851     m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    852     m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    853   }
    854 #endif
    855 
    856   Int cIdx = 0;
    857 #if H_MV
    858   if ( getInterRefEnabledInRPLFlag() )
    859   { 
    860 #endif
    861   for ( i=0; i<NumPocStCurr0; i++, cIdx++)
    862   {
    863     rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
    864   }
    865   for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    866   {
    867     rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
    868   }
    869   for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
    870   {
    871     rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    872   }
    873 #if H_MV
    874   }
    875   for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
    876     {
    877     assert( cIdx < MAX_NUM_REF );   
    878       rpsCurrList0[cIdx] = refPicSetInterLayer[i];
    879     }
    880 #endif
    881   assert(cIdx == numPocTotalCurr);
    882 
    883   if (m_eSliceType==B_SLICE)
    884   {
    885     cIdx = 0;
    886 #if H_MV
    887     if ( getInterRefEnabledInRPLFlag() )
    888     { 
    889 #endif
    890     for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    891     {
    892       rpsCurrList1[cIdx] = RefPicSetStCurr1[i];
    893     }
    894     for ( i=0; i<NumPocStCurr0; i++, cIdx++)
    895     {
    896       rpsCurrList1[cIdx] = RefPicSetStCurr0[i];
    897     }
    898     for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
    899     {
    900       rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
    901     }
    902 #if H_MV
    903     }
    904     for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
    905       {
    906       assert( cIdx < MAX_NUM_REF );   
    907         rpsCurrList1[cIdx] = refPicSetInterLayer[i];
    908       }
    909 #endif
    910     assert(cIdx == numPocTotalCurr);
    911   }
    912 
    913   ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
    914 
    915 #if H_MV
    916   Int numPocSt = NumPocStCurr0 + NumPocStCurr1;
    917   assert(  getInterRefEnabledInRPLFlag( ) || numPocSt == 0 );
    918 
    919   for (Int li = 0; li < 2; li++)
    920   {
    921     if ( m_eSliceType == P_SLICE && li == 1 )
    922     {
    923       m_aiNumRefIdx[1] = 0;
    924       ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
    925     }
    926     else
    927     {
    928       for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)
    929       {
    930         Bool listModified             =                m_RefPicListModification.getRefPicListModificationFlagL( li );
    931         Int orgIdx                    = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr);
    932 
    933         m_apcRefPicList    [li][rIdx] = ( li == 0 )  ? rpsCurrList0[ orgIdx  ] : rpsCurrList1[ orgIdx  ];
    934         m_bIsUsedAsLongTerm[li][rIdx] = ( orgIdx >= numPocSt ) ;
    935       }
    936     }
    937   }
    938 #else
    939   for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)
    940   {
    941     cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;
    942     assert(cIdx >= 0 && cIdx < numPocTotalCurr);
    943     m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
    944     m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
    945   }
    946   if ( m_eSliceType != B_SLICE )
    947   {
    948     m_aiNumRefIdx[1] = 0;
    949     ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
    950   }
    951   else
    952   {
    953     for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)
    954     {
    955       cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;
    956       assert(cIdx >= 0 && cIdx < numPocTotalCurr);
    957       m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];
    958       m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
    959     }
    960   }
    961 #endif
    962 }
    963 
    964 #endif
    965 Int TComSlice::getNumRpsCurrTempList()
    966 {
    967   Int numRpsCurrTempList = 0;
    968 
    969   if (m_eSliceType == I_SLICE)
    970   {
    971     return 0;
    972   }
    973   for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)
    974   {
    975     if(m_pcRPS->getUsed(i))
    976     {
    977       numRpsCurrTempList++;
    978     }
    979   }
    980 #if H_MV
    981 #if !H_MV5
    982   assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() );
    983 #endif
    984727  numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
    985728#endif
     
    1063806}
    1064807
    1065 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
     808Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic)
    1066809{
    1067810  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    1089832  {
    1090833    pocCRA = getPOC();
    1091     prevRAPisBLA = false;
     834    associatedIRAPType = getNalUnitType();
    1092835  }
    1093836  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    1094837  {
    1095838    pocCRA = getPOC();
    1096     prevRAPisBLA = false;
     839    associatedIRAPType = getNalUnitType();
    1097840  }
    1098841  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     
    1101844  {
    1102845    pocCRA = getPOC();
    1103     prevRAPisBLA = true;
     846    associatedIRAPType = getNalUnitType();
    1104847  }
    1105848}
     
    1126869{
    1127870  TComPic*                 rpcPic;
     871  setAssociatedIRAPPOC(pocCRA);
    1128872  Int pocCurr = getPOC();
    1129873
     
    12951039#if H_MV
    12961040  // Additional slice header syntax elements
    1297 #if H_MV5
    12981041  m_pocResetFlag               = pSrc->m_pocResetFlag;
    1299 #endif
    13001042  m_discardableFlag            = pSrc->m_discardableFlag;
    13011043  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
     
    13061048    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
    13071049  }
    1308 #if !H_MV5
    1309   m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;
    1310   m_altCollocatedIndicationFlag  = pSrc->m_altCollocatedIndicationFlag ;   
    1311   m_collocatedRefLayerIdx        = pSrc->m_collocatedRefLayerIdx       ;
    1312   m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers;
    1313 
    1314   for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++)
    1315   {   
    1316     m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];
    1317   }
    1318 #endif
    13191050#endif
    13201051#if H_3D_IC
     
    13241055}
    13251056
    1326 Int TComSlice::m_prevPOC = 0;
     1057Int TComSlice::m_prevTid0POC = 0;
    13271058
    13281059/** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
     
    13791110}
    13801111
     1112
     1113Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic)
     1114{
     1115  TComPic* rpcPic;
     1116
     1117  Int nalUnitType = this->getNalUnitType();
     1118
     1119  // When a picture is a leading picture, it shall be a RADL or RASL picture.
     1120  if(this->getAssociatedIRAPPOC() > this->getPOC())
     1121  {
     1122    // Do not check IRAP pictures since they may get a POC lower than their associated IRAP
     1123    if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP ||
     1124       nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23)
     1125    {
     1126      assert(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1127             nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
     1128             nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1129             nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R);
     1130    }
     1131  }
     1132
     1133  // When a picture is a trailing picture, it shall not be a RADL or RASL picture.
     1134  if(this->getAssociatedIRAPPOC() < this->getPOC())
     1135  {
     1136    assert(nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N &&
     1137           nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R &&
     1138           nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N &&
     1139           nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R);
     1140  }
     1141
     1142  // No RASL pictures shall be present in the bitstream that are associated
     1143  // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP.
     1144  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1145     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1146  {
     1147    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_W_RADL &&
     1148           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP);
     1149  }
     1150
     1151  // No RASL pictures shall be present in the bitstream that are associated with
     1152  // an IDR picture.
     1153  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1154     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1155  {
     1156    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP   &&
     1157           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL);
     1158  }
     1159
     1160  // No RADL pictures shall be present in the bitstream that are associated with
     1161  // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated
     1162  // with an IDR picture having nal_unit_type equal to IDR_N_LP.
     1163  if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1164     nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
     1165  {
     1166    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP   &&
     1167           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP);
     1168  }
     1169
     1170  // loop through all pictures in the reference picture buffer
     1171  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1172  while ( iterPic != rcListPic.end())
     1173  {
     1174    rpcPic = *(iterPic++);
     1175    if (rpcPic->getPOC() == this->getPOC())
     1176    {
     1177      continue;
     1178    }
     1179
     1180    // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture
     1181    // in decoding order shall precede the IRAP picture in output order.
     1182    // (Note that any picture following in output order would be present in the DPB)
     1183    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1184    {
     1185      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     1186         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP    ||
     1187         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL  ||
     1188         nalUnitType == NAL_UNIT_CODED_SLICE_CRA         ||
     1189         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP    ||
     1190         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     1191      {
     1192        assert(rpcPic->getPOC() < this->getPOC());
     1193      }
     1194    }
     1195
     1196    // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture
     1197    // in decoding order shall precede any RADL picture associated with the IRAP
     1198    // picture in output order.
     1199    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1200    {
     1201      if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1202          nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R))
     1203      {
     1204        // rpcPic precedes the IRAP in decoding order
     1205        if(this->getAssociatedIRAPPOC() > rpcPic->getSlice(0)->getAssociatedIRAPPOC())
     1206        {
     1207          // rpcPic must not be the IRAP picture
     1208          if(this->getAssociatedIRAPPOC() != rpcPic->getPOC())
     1209          {
     1210            assert(rpcPic->getPOC() < this->getPOC());
     1211          }
     1212        }
     1213      }
     1214    }
     1215
     1216    // When a picture is a leading picture, it shall precede, in decoding order,
     1217    // all trailing pictures that are associated with the same IRAP picture.
     1218    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1219       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
     1220       nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1221       nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
     1222    {
     1223      if(rpcPic->getSlice(0)->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
     1224      {
     1225        // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB
     1226        // rpcPic would violate the constraint if it was a trailing picture
     1227        assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC());
     1228      }
     1229    }
     1230
     1231    // Any RASL picture associated with a CRA or BLA picture shall precede any
     1232    // RADL picture associated with the CRA or BLA picture in output order
     1233    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1234       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1235    {
     1236      if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
     1237          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
     1238          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
     1239          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)       &&
     1240          this->getAssociatedIRAPPOC() == rpcPic->getSlice(0)->getAssociatedIRAPPOC())
     1241      {
     1242        if(rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
     1243           rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R)
     1244        {
     1245          assert(rpcPic->getPOC() > this->getPOC());
     1246        }
     1247      }
     1248    }
     1249
     1250    // Any RASL picture associated with a CRA picture shall follow, in output
     1251    // order, any IRAP picture that precedes the CRA picture in decoding order.
     1252    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1253       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1254    {
     1255      if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
     1256      {
     1257        if(rpcPic->getSlice(0)->getPOC() < this->getAssociatedIRAPPOC() &&
     1258           (rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
     1259            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
     1260            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
     1261            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP   ||
     1262            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
     1263            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
     1264        {
     1265          assert(this->getPOC() > rpcPic->getSlice(0)->getPOC());
     1266        }
     1267      }
     1268    }
     1269  }
     1270}
     1271
     1272
     1273
    13811274/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    13821275*/
     
    13851278  TComPic* rpcPic;
    13861279  Int i, isReference;
     1280
     1281  checkLeadingPictureRestrictions(rcListPic);
    13871282
    13881283  // loop through all pictures in the reference picture buffer
     
    14211316      else
    14221317      {
    1423         if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
     1318        Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1319        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1);
     1320        Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
     1321        if(rpcPic->getIsLongTerm() && curPoc == refPoc)
    14241322        {
    14251323          isReference = 1;
     
    14811379      else
    14821380      {
    1483         if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced())
     1381        Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1382        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1);
     1383        Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
     1384        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    14841385        {
    14851386          isAvailable = 1;
     
    15001401        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
    15011402        {
    1502           curPoc = curPoc % pocCycle;
    1503           refPoc = refPoc % pocCycle;
     1403          curPoc = curPoc & (pocCycle - 1);
     1404          refPoc = refPoc & (pocCycle - 1);
    15041405        }
    15051406       
     
    17811682: m_VPSId                     (  0)
    17821683, m_uiMaxTLayers              (  1)
    1783 #if H_MV5
    17841684#if H_MV
    17851685, m_uiMaxLayersMinus1         (  0)
    1786 #else
    1787 , m_uiMaxLayers               (  1)
    1788 #endif
    17891686#else
    17901687, m_uiMaxLayers               (  1)
     
    18001697, m_hrdOpSetIdx               (NULL)
    18011698, m_cprmsPresentFlag          (NULL)
    1802 #if H_MV5
    18031699#if H_MV
    18041700, m_vpsVUI                 (  NULL )
    1805 #endif
    18061701#endif
    18071702{
     
    18481743
    18491744  m_avcBaseLayerFlag = false;
    1850 #if H_MV5
    18511745  m_vpsVuiOffset     = 0;
    1852 #endif
    18531746  m_splittingFlag    = false;
    18541747 
    18551748  for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ )
    18561749  {
    1857 #if H_MV5
    18581750    m_scalabilityMaskFlag[i] = false;
    1859 #else
    1860     m_scalabilityMask[i] = false;
    1861 #endif
    18621751    m_dimensionIdLen [i]  = -1;
    18631752  }
     
    18851774    m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1;
    18861775    m_numDirectRefLayers[i] = 0;
    1887 #if H_MV5
    18881776    m_maxTidIlRefPicPlus1[i] = 7;
    18891777    m_vpsRepFormatIdx    [i] = 0;
    18901778    m_repFormat          [i] = NULL;
    18911779    m_viewIdVal          [i] = 0;
    1892 #else
    1893     m_maxTidIlRefPicPlus1[i] = -1;
    1894 #endif
    18951780
    18961781#if H_3D
     
    19351820#endif
    19361821  }
    1937 #if H_MV5
    19381822  m_vpsVUI = new TComVPSVUI;
    1939 #endif
    19401823#if H_3D
    19411824  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    19501833    m_depthRefinementFlag  [ i ] = false;
    19511834#endif
    1952 #if LGE_INTER_SDC_E0156
     1835#if H_3D_INTER_SDC
    19531836    m_bInterSDCFlag        [ i ] = false;
    19541837#endif
     
    19631846  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
    19641847  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
    1965 #if H_MV5
    19661848#if H_MV
    19671849  if ( m_vpsVUI          != NULL )     delete m_vpsVUI;
     
    19831865#endif
    19841866  }
    1985 #endif
    1986 #else
    1987 #if H_3D_DIM_DLT
    1988   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    1989   {
    1990     if ( m_iDepthValue2Idx[i] != 0 )
    1991     {
    1992        xFree( m_iDepthValue2Idx[i] );
    1993        m_iDepthValue2Idx[i] = 0;
    1994     }
    1995 
    1996     if ( m_iIdx2DepthValue[i] != 0 )
    1997     {
    1998       xFree( m_iIdx2DepthValue[i] );
    1999       m_iIdx2DepthValue[i] = 0;
    2000 
    2001     }
    2002   }
    2003 #endif
    20041867#endif
    20051868}
     
    20721935Bool TComVPS::checkVPSExtensionSyntax()
    20731936{
    2074 #if H_MV5
    20751937  for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ )
    2076 #else
    2077   for( Int layer = 1; layer < getMaxLayers(); layer++ )
    2078 #endif
    20791938  {
    20801939    // check layer_id_in_nuh constraint
     
    20921951{
    20931952  assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES );
    2094 #if H_MV5
    20951953  assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) );
    2096 #else
    2097   assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );
    2098 #endif
    20991954  Int scalIdx = 0;
    21001955  for( Int curScalType = 0; curScalType < scalType; curScalType++ )
    21011956  {
    2102 #if H_MV5
    21031957    scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 );
    2104 #else
    2105     scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );
    2106 #endif
    21071958
    21081959  }
     
    21101961  return scalIdx;
    21111962}
    2112 #if H_MV5
    21131963Void TComVPS::setScalabilityMaskFlag( UInt val )
    21141964{
     
    21181968  }
    21191969}
    2120 #else
    2121 Void TComVPS::setScalabilityMask( UInt val )
    2122 {
    2123   for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ )
    2124     setScalabilityMask( scalType, ( val & (1 << scalType ) ) != 0 );
    2125 }
    2126 
    2127 #endif
    2128 
    2129 #if H_MV5
     1970
    21301971Void TComVPS::setRefLayers()
    21311972{
     
    21762017}
    21772018#endif // H_3D
    2178 #else
    2179 Void TComVPS::setRefLayers()
    2180 {
    2181   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    2182   {
    2183     m_numSamplePredRefLayers[ i ] = 0;
    2184     m_numMotionPredRefLayers[ i ] = 0;
    2185     m_numDirectRefLayers[ i ] = 0;
    2186     for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) {
    2187       m_samplePredEnabledFlag[ i ][ j ] = 0;
    2188       m_motionPredEnabledFlag[ i ][ j ] = 0;
    2189       m_refLayerId[ i ][ j ] = 0;
    2190       m_samplePredRefLayerId[ i ][ j ] = 0;
    2191       m_motionPredRefLayerId[ i ][ j ] = 0;
    2192     }
    2193   }
    2194 
    2195   for( Int i = 1; i  <= getMaxLayers()- 1; i++ )
    2196   {
    2197     for( Int j = 0; j < i; j++ )
    2198     {
    2199       if( getDirectDependencyFlag(i,j) )
    2200       {
    2201         m_refLayerId[ i ][m_numDirectRefLayers[ i ]++ ] = getLayerIdInNuh( j );
    2202 
    2203         m_samplePredEnabledFlag [ i ][ j ]  = ( (   getDirectDependencyType( i , j ) + 1 ) & 1 ) == 1;
    2204         m_numSamplePredRefLayers[ i ]      += m_samplePredEnabledFlag [ i ][ j ] ? 1 : 0;
    2205         m_motionPredEnabledFlag [ i ][ j ]  = ( ( ( getDirectDependencyType( i , j ) + 1 ) & 2 ) >> 1 ) == 1;
    2206         m_numMotionPredRefLayers[ i ]      += m_motionPredEnabledFlag  [ i][ j ] ? 1 : 0;
    2207       }
    2208     }
    2209   }
    2210 
    2211   for( Int i = 1, mIdx = 0, sIdx = 0; i <= getMaxLayers()- 1; i++ )
    2212   {   
    2213     for( Int j = 0 ; j < i; j++ )
    2214     {
    2215       if( m_motionPredEnabledFlag[ i ][ j ] )
    2216       {
    2217         m_motionPredRefLayerId[ i ][ mIdx++ ] = getLayerIdInNuh( j );
    2218       }
    2219      
    2220       if( m_samplePredEnabledFlag[ i ][ j ] )
    2221       {
    2222         m_samplePredRefLayerId[ i ][ sIdx++ ] = getLayerIdInNuh( j );
    2223       }
    2224     }
    2225   }
    2226 }
    2227 
    2228 Int TComVPS::getRefLayerId( Int layerIdInVps, Int idx )
    2229 {
    2230   assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInVps] );     
    2231   Int layerIdInNuh = m_refLayerId[ layerIdInVps ][ idx ];   
    2232   assert ( layerIdInNuh >= 0 );
    2233   return layerIdInNuh;
    2234 }
    2235 
    2236 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
    2237 {
    2238   return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
    2239 }
    2240 
    2241 #if H_3D
    2242 Void TComVPS::initViewIndex()
    2243 {
    2244   Int viewIdList   [ MAX_NUM_LAYERS ]; // ed. should be changed to MAX_VIEW_ID
    2245   Int viewIndexList[ MAX_NUM_LAYERS ];
    2246   Int numViewIds = 0;
    2247 
    2248   for ( Int i = 0 ; i  <  m_uiMaxLayers; i++ )
    2249   {     
    2250     Int currViewId = getViewId( i );
    2251 
    2252     Bool viewIdInListFlag = false;
    2253     for ( Int j = 0; j < numViewIds; j ++ )
    2254     {
    2255       viewIdInListFlag  = viewIdInListFlag || ( currViewId  == viewIdList[ j ]  );
    2256     }
    2257 
    2258     if ( !viewIdInListFlag )
    2259     {
    2260       viewIdList   [ numViewIds ] = currViewId;
    2261       viewIndexList[ currViewId ] = numViewIds;
    2262 
    2263       numViewIds++;
    2264     } 
    2265 
    2266     m_viewIndex[ i ] = viewIndexList[ currViewId ];
    2267   }
    2268 }
    2269 
    2270 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )
    2271 {
    2272   Int foundlayerId = -1;
    2273 
    2274   for (Int layer = 0 ; layer < m_uiMaxLayers; layer++ )
    2275   {
    2276     if( ( getViewIndex( layer ) == viewIndex ) && ( getDepthId( layer ) == ( depthFlag ? 1 : 0 ) )  )
    2277     {
    2278       foundlayerId = layer;
    2279       break;
    2280     }
    2281   }
    2282   assert( foundlayerId != -1 );
    2283 
    2284   return getLayerIdInNuh( foundlayerId );
    2285 }
    2286 
    2287 #endif // H_3D
    2288 
    2289 Int TComVPS::xCeilLog2( Int val )
    2290 {
    2291   assert( val > 0 );
    2292   Int ceilLog2 = 0;
    2293   while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
    2294   return ceilLog2;
    2295 }
    2296 
    2297 #endif // H_MV5
    22982019
    22992020
     
    23362057  return numLayersInIdList;
    23372058}
    2338 #if H_MV5
    23392059Int TComVPS::getNumViews()
    23402060{
     
    23662086  return dependentFlag;
    23672087}
    2368 #endif
    23692088#endif // H_MV
    23702089
     
    24172136, m_vuiParameters             ()
    24182137#if H_MV
    2419 #if H_MV5
    24202138, m_pcVPS                     ( NULL )
    24212139, m_spsInferScalingListFlag   ( false )
     
    24232141, m_updateRepFormatFlag       ( true )
    24242142, m_interViewMvVertConstraintFlag (false)
    2425 #else
    2426 , m_interViewMvVertConstraintFlag (false)
    2427 , m_numIlpRestrictedRefLayers ( 0 )
    2428 #endif
    24292143#endif
    24302144#if H_3D
     
    24412155  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    24422156  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    2443 #if !H_MV5
    2444 #if H_MV
    2445   for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    2446   {
    2447     m_minSpatialSegmentOffsetPlus1[ i ] = 0;
    2448     m_ctuBasedOffsetEnabledFlag   [ i ] = false;
    2449     m_minHorizontalCtuOffsetPlus1 [ i ] = 0;
    2450   }
    2451 #endif
    2452 #endif
    24532157}
    24542158
     
    26032307, m_listsModificationPresentFlag(  0)
    26042308, m_numExtraSliceHeaderBits(0)
    2605 #if H_MV5
    26062309#if H_MV
    26072310, m_ppsInferScalingListFlag(false)
    26082311, m_ppsScalingListRefLayerId(0)
    26092312#endif
    2610 #endif
    26112313{
    26122314  m_scalingList = new TComScalingList;
     
    26282330}
    26292331
    2630 #if H_MV5
    26312332#if H_MV
    26322333Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr )
     
    26792380  }
    26802381}
    2681 #endif
    26822382#endif
    26832383#if H_3D
     
    29082608TComScalingList::TComScalingList()
    29092609{
    2910   m_useTransformSkip = false;
    29112610  init();
    29122611}
     
    29502649
    29512650#if H_MV
    2952 #if H_MV5
    29532651Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 )
    29542652{
     
    29822680  }
    29832681}
    2984 #else
    2985 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer )
    2986 {
    2987   refPicSetInterLayer.clear();
    2988 
    2989   for( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
    2990   {
    2991     Int layerIdRef = getRefPicLayerId( i );
    2992     TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ;
    2993     assert ( picRef != 0 );
    2994 
    2995     picRef->getPicYuvRec()->extendPicBorder();
    2996     picRef->setIsLongTerm( true );       
    2997     picRef->getSlice(0)->setReferenced( true );       
    2998 
    2999     // Consider to check here:
    3000     // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. "
    3001     refPicSetInterLayer.push_back( picRef );
    3002   }
    3003 }
    3004 #endif
    3005 
    3006 #if H_MV5
     2682
    30072683Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
    30082684{
     
    30192695
    30202696}
    3021 #else
    3022 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )
    3023 {
    3024   // Mark as shortterm
    3025   for ( Int i = 0; i < refPicSetInterLayer.size(); i++ )
    3026   {
    3027     refPicSetInterLayer[i]->setIsLongTerm( false );
    3028   }
    3029 }
    3030 
    3031 #endif
    30322697Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    30332698{
     
    30352700  if (targetDecLayerIdSet.size() == 0 )   
    30362701  {
    3037 #if H_MV5
    30382702    for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )
    3039 #else
    3040     for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )
    3041 #endif
    30422703    {
    30432704      targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );
     
    30682729          if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
    30692730          {
    3070 #if H_MV5
    30712731            for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
    30722732            {
    30732733              if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
    3074 #else
    3075             Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] );
    3076             for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )
    3077             {
    3078               if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS,  k  ) )
    3079 #endif
    30802734              {
    30812735                remainingInterLayerReferencesFlag = true;
     
    30932747}
    30942748
    3095 #if H_MV5
    30962749Void TComSlice::printRefPicList()
    3097 #else
    3098 Void TComSlice::xPrintRefPicList()
    3099 #endif
    31002750
    31012751  for ( Int li = 0; li < 2; li++)
     
    31102760  }
    31112761}
    3112 #if !H_MV5
    3113 Int TComSlice::xCeilLog2( Int val )
    3114 {
    3115   assert( val > 0 );
    3116   Int ceilLog2 = 0;
    3117   while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
    3118   return ceilLog2;
    3119 }
    3120 #endif
    31212762
    31222763Void TComSlice::markCurrPic( TComPic* currPic )
     
    31332774}
    31342775
    3135 #if H_MV5
    31362776Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 )
    31372777{
     
    31582798  return pcPic;
    31592799}
    3160 #else
    3161 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )
    3162 {
    3163   m_refPicSetInterLayer = refPicSetInterLayer;
    3164 }
    3165 
    3166 TComPic* TComSlice::getPicFromRefPicSetInterLayer( Int layerId )
    3167 {
    3168   assert( m_refPicSetInterLayer != 0 );
    3169   assert( (*m_refPicSetInterLayer).size() == getNumActiveRefLayerPics() );
    3170   TComPic* pcPic = NULL;
    3171   for ( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
    3172   {
    3173     if ((*m_refPicSetInterLayer)[ i ]->getLayerId() == layerId)
    3174     {
    3175       pcPic = (*m_refPicSetInterLayer)[ i ];
    3176     }
    3177   }
    3178   assert(pcPic != NULL);
    3179   return pcPic;
    3180 }
    3181 #endif
    31822800Int TComSlice::getNumActiveRefLayerPics()
    31832801{
    31842802  Int numActiveRefLayerPics;
    31852803
    3186 #if H_MV5
    31872804  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) ==  0 )
    31882805  {
     
    31982815  }
    31992816  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    3200 #else
    3201   if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) ==  0 || !getInterLayerPredEnabledFlag() )
    3202   {
    3203     numActiveRefLayerPics = 0;
    3204   }
    3205   else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )
    3206 #endif
    32072817  {
    32082818    numActiveRefLayerPics = 1;
     
    32172827Int TComSlice::getRefPicLayerId( Int i )
    32182828{
    3219 #if H_MV5
    32202829  return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) );
    3221 #else
    3222   return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) );
    3223 #endif
    3224 }
    3225 
    3226 #if !H_MV5
    3227 Void TComSlice::setActiveMotionPredRefLayers()
    3228 {
    3229   Int j = 0;
    3230   for( Int i = 0; i < getNumActiveRefLayerPics(); i++)
    3231   {
    3232     if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i ))  )
    3233     {
    3234       m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i );
    3235     }
    3236   }
    3237   m_numActiveMotionPredRefLayers = j;
    3238 
    3239   // Consider incorporating bitstream conformance tests on derived variables here.
    3240 }
    3241 
    3242 Bool TComSlice::getInterRefEnabledInRPLFlag()
    3243 {
    3244   Bool interRefEnabledInRPLFlag;
    3245   if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 )
    3246   {
    3247     interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag();
    3248   }
    3249   else
    3250   {
    3251     interRefEnabledInRPLFlag = 1;
    3252   }
    3253   return interRefEnabledInRPLFlag;
    3254 }
    3255 #endif
     2830}
     2831
    32562832#if H_3D_ARP
    32572833Void TComSlice::setARPStepNum()                                 
     
    35313107}
    35323108
    3533 #if H_MV5
    35343109#if H_MV
    35353110Void TComScalingList::inferFrom( TComScalingList* srcScLi )
     
    35453120  }
    35463121}
    3547 #endif
    35483122#endif
    35493123/** initialization process of quantization matrix array
     
    36363210, m_ppsMap(MAX_NUM_PPS)
    36373211, m_activeVPSId(-1)
    3638 #if H_MV5
    36393212#if !H_MV
    36403213, m_activeSPSId(-1)
     
    36493222  }
    36503223#endif
    3651 #else
    3652 , m_activeSPSId(-1)
    3653 , m_activePPSId(-1)
    3654 {
    3655 #endif
    36563224}
    36573225
     
    36633231//! activate a SPS from a active parameter sets SEI message
    36643232//! \returns true, if activation is successful
    3665 #if H_MV5
    36663233#if H_MV
    36673234Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId )
     
    36693236Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
    36703237#endif
    3671 #else
    3672 Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
    3673 #endif
    36743238{
    36753239  TComSPS *sps = m_spsMap.getPS(spsId);
     
    36803244    {
    36813245      m_activeVPSId = vpsId;
    3682 #if !H_MV5
    3683       m_activeSPSId = spsId;
    3684 #else
    36853246#if H_MV
    36863247      m_activeSPSId[ layerId ] = spsId;
     
    36883249      m_activeSPSId = spsId;
    36893250#endif
    3690 #endif
    36913251      return true;
    36923252    }
     
    37053265//! activate a PPS and depending on isIDR parameter also SPS and VPS
    37063266//! \returns true, if activation is successful
    3707 #if H_MV5
    37083267#if H_MV
    37093268Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId )
     
    37423301        m_activeSPSId[ layerId ] = spsId;
    37433302#else
    3744         m_activePPSId = ppsId;
    3745         m_activeVPSId = vpsId;
    3746         m_activeSPSId = spsId;
    3747 #endif
    3748 #else
    3749 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
    3750 {
    3751   TComPPS *pps = m_ppsMap.getPS(ppsId);
    3752   if (pps)
    3753   {
    3754     Int spsId = pps->getSPSId();
    3755 #if H_MV
    3756     // active parameter sets per layer should be used here
    3757 #else
    3758     if (!isIRAP && (spsId != m_activeSPSId))
    3759     {
    3760       printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
    3761       return false;
    3762     }
    3763 #endif
    3764     TComSPS *sps = m_spsMap.getPS(spsId);
    3765     if (sps)
    3766     {
    3767       Int vpsId = sps->getVPSId();
    3768       if (!isIRAP && (vpsId != m_activeVPSId))
    3769       {
    3770         printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
    3771         return false;
    3772       }
    3773       if (m_vpsMap.getPS(vpsId))
    3774       {
    37753303        m_activePPSId = ppsId;
    37763304        m_activeVPSId = vpsId;
     
    38283356//! \}
    38293357
    3830 #if H_MV5
    38313358#if H_MV
    38323359TComVPSVUI::TComVPSVUI()
     
    38613388}
    38623389#endif
    3863 #endif
Note: See TracChangeset for help on using the changeset viewer.