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


Ignore:
Timestamp:
11 Sep 2013, 14:40:25 (11 years ago)
Author:
tech
Message:

Merged 8.0-dev0@621 (MV-HEVC 5 HLS).

File:
1 edited

Legend:

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

    r608 r622  
    101101, m_enableTMVPFlag                ( true )
    102102#if H_MV
     103#if H_MV5
     104, m_refPicSetInterLayer0           ( NULL )
     105, m_refPicSetInterLayer1           ( NULL )
     106#else
    103107, m_refPicSetInterLayer           ( NULL )
     108#endif
    104109, m_layerId                       (0)
    105110, m_viewId                        (0)
     111#if H_MV5
     112, m_viewIndex                     (0)
     113#endif
    106114#if H_3D
     115#if !H_MV5
    107116, m_viewIndex                     (0)
     117#endif
    108118, m_isDepth                       (false)
     119#endif
     120#if H_MV5
     121, m_pocResetFlag                  (false)
    109122#endif
    110123, m_discardableFlag               (false)
    111124, m_interLayerPredEnabledFlag     (false)
    112125, m_numInterLayerRefPicsMinus1    (0)
     126#if !H_MV5
    113127, m_interLayerSamplePredOnlyFlag  (false)
    114128, m_altCollocatedIndicationFlag   (0)
    115129, m_collocatedRefLayerIdx         (0)
     130#endif
    116131#if H_3D_IC
    117132, m_bApplyIC                      ( false )
     
    149164  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    150165  {
     166#if H_MV5
     167   m_interLayerPredLayerIdc[ i ] = i;
     168#else
    151169   m_interLayerPredLayerIdc[ i ] = 0;
     170#endif
    152171  }
    153172#endif
     
    162181  {
    163182    if ( m_depthToDisparityB && m_depthToDisparityB[ i ] )
     183    {
    164184      delete[] m_depthToDisparityB [ i ];
     185    }
    165186
    166187    if ( m_depthToDisparityF && m_depthToDisparityF[ i ] )
     188    {
    167189      delete[] m_depthToDisparityF [ i ];
    168190  }
     191  }
    169192
    170193  if ( m_depthToDisparityF )
     194  {
    171195    delete[] m_depthToDisparityF;
     196  }
    172197
    173198  m_depthToDisparityF = NULL;
     
    362387  }
    363388}
    364 #if H_MV
    365 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
    366 #else
     389#if H_MV5
     390#if !H_MV
    367391#if FIX1071
    368392Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
     
    370394Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
    371395#endif
    372 #endif
    373396{
    374397#if FIX1071
     
    380403      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    381404      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    382      
     405
    383406      return;
    384407    }
    385    
    386 #if !H_MV
     408
    387409    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    388410    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    389 #endif
    390411  }
    391412
     
    411432    }
    412433  }
     434
     435  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
     436  {
     437    if(m_pcRPS->getUsed(i))
     438    {
     439      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
     440      pcRefPic->setIsLongTerm(0);
     441      pcRefPic->getPicYuvRec()->extendPicBorder();
     442      RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;
     443      NumPocStCurr1++;
     444      pcRefPic->setCheckLTMSBPresent(false); 
     445    }
     446  }
     447
     448  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
     449  {
     450    if(m_pcRPS->getUsed(i))
     451    {
     452      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     453      pcRefPic->setIsLongTerm(1);
     454      pcRefPic->getPicYuvRec()->extendPicBorder();
     455      RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
     456      NumPocLtCurr++;
     457    }
     458    if(pcRefPic==NULL)
     459    {
     460      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     461    }
     462    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     463  }
     464
     465  // ref_pic_list_init
     466  TComPic*  rpsCurrList0[MAX_NUM_REF+1];
     467  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
     468  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
     469
     470#if FIX1071
     471  if (checkNumPocTotalCurr)
     472  {
     473    // 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.
     476    if (getRapPicFlag())
     477    {
     478      assert(numPocTotalCurr == 0);
     479    }
     480
     481    if (m_eSliceType == I_SLICE)
     482    {
     483      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     484      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     485
     486      return;
     487    }
     488
     489    assert(numPocTotalCurr > 0);
     490
     491    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     492    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     493  }
     494#endif
     495
     496  Int cIdx = 0;
     497  for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     498  {
     499    rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
     500  }
     501  for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     502  {
     503    rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
     504  }
     505  for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     506  {
     507    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
     508  }
     509  assert(cIdx == numPocTotalCurr);
     510
     511  if (m_eSliceType==B_SLICE)
     512  {
     513    cIdx = 0;
     514    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     515    {
     516      rpsCurrList1[cIdx] = RefPicSetStCurr1[i];
     517    }
     518    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     519    {
     520      rpsCurrList1[cIdx] = RefPicSetStCurr0[i];
     521    }
     522    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     523    {
     524      rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
     525    }
     526    assert(cIdx == numPocTotalCurr);
     527  }
     528
     529  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
     530
     531  for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)
     532  {
     533    cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;
     534    assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     535    m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
     536    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     537  }
     538  if ( m_eSliceType != B_SLICE )
     539  {
     540    m_aiNumRefIdx[1] = 0;
     541    ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
     542  }
     543  else
     544  {
     545    for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)
     546    {
     547      cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;
     548      assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     549      m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];
     550      m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     551    }
     552  }
     553}
     554
     555#else
     556Void TComSlice::getTempRefPicLists( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1,                                     
     557                                   std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr )
     558{
     559  if (!checkNumPocTotalCurr)
     560  {
     561    if (m_eSliceType == I_SLICE)
     562    {     
     563      return;
     564    }   
     565  }
     566
     567  TComPic*  pcRefPic= NULL;
     568  TComPic*  RefPicSetStCurr0[16];
     569  TComPic*  RefPicSetStCurr1[16];
     570  TComPic*  RefPicSetLtCurr[16];
     571  UInt NumPocStCurr0 = 0;
     572  UInt NumPocStCurr1 = 0;
     573  UInt NumPocLtCurr = 0;
     574  Int i;
     575
     576  for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
     577  {
     578    if(m_pcRPS->getUsed(i))
     579    {
     580      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
     581      pcRefPic->setIsLongTerm(0);
     582      pcRefPic->getPicYuvRec()->extendPicBorder();
     583      RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;
     584      NumPocStCurr0++;
     585      pcRefPic->setCheckLTMSBPresent(false); 
     586    }
     587  }
     588 
     589  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
     590  {
     591    if(m_pcRPS->getUsed(i))
     592    {
     593      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
     594      pcRefPic->setIsLongTerm(0);
     595      pcRefPic->getPicYuvRec()->extendPicBorder();
     596      RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;
     597      NumPocStCurr1++;
     598      pcRefPic->setCheckLTMSBPresent(false); 
     599    }
     600  }
     601 
     602  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
     603  {
     604    if(m_pcRPS->getUsed(i))
     605    {
     606      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     607      pcRefPic->setIsLongTerm(1);
     608      pcRefPic->getPicYuvRec()->extendPicBorder();
     609      RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
     610      NumPocLtCurr++;
     611    }
     612    if(pcRefPic==NULL)
     613    {
     614      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
     615    }
     616    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     617  }
     618
     619  Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
     620  numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );
     621  assert( numPocTotalCurr == getNumRpsCurrTempList() );
     622
     623  if (checkNumPocTotalCurr)
     624  {
     625    // 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:
     626    // - 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.
     627    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     628    if ( getRapPicFlag() && m_layerId == 0 )
     629    {
     630      assert(numPocTotalCurr == 0);
     631    }
     632
     633    if (m_eSliceType == I_SLICE)
     634    {
     635      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     636      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     637     
     638      return;
     639    }
     640   
     641    assert(numPocTotalCurr > 0);
     642   
     643    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     644    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     645  }
     646
     647  std::vector<TComPic*>* refPicSetInterLayer[2] = { &refPicSetInterLayer0, &refPicSetInterLayer1};
     648  Int numPocInterLayer[2] = { getNumActiveRefLayerPics0( ), getNumActiveRefLayerPics1( ) };
     649 
     650  TComPic**             refPicSetStCurr    [2] = { RefPicSetStCurr0, RefPicSetStCurr1 };
     651  Int numPocStCurr[2] = { NumPocStCurr0, NumPocStCurr1 };
     652
     653  for (Int li = 0; li < ((m_eSliceType==B_SLICE) ? 2 : 1); li++)
     654  {
     655    rpsCurrList   [li].resize(MAX_NUM_REF+1,NULL );
     656    usedAsLongTerm[li].resize(MAX_NUM_REF+1,false);
     657
     658    Int cIdx = 0;
     659    for ( i=0; i < numPocStCurr[li]; i++, cIdx++)
     660    {
     661      rpsCurrList[li][cIdx] = refPicSetStCurr[li][i];
     662      usedAsLongTerm [li][cIdx] = false; 
     663    }
     664
     665    for ( i=0; i < numPocInterLayer[li];  i++, cIdx++)
     666    {   
     667      rpsCurrList[li][cIdx] = (*refPicSetInterLayer[li])[i];
     668      usedAsLongTerm [li][cIdx] = true; 
     669    }
     670
     671    for ( i=0; i < numPocStCurr[1-li]; i++, cIdx++)
     672    {
     673      rpsCurrList[li][cIdx] = refPicSetStCurr[1-li][i];
     674      usedAsLongTerm [li][cIdx] = false; 
     675    }
     676
     677    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     678    {
     679      rpsCurrList[li][cIdx] = RefPicSetLtCurr[i];
     680      usedAsLongTerm [li][cIdx] = true; 
     681    }
     682
     683    for ( i=0; i < numPocInterLayer[1-li];  i++, cIdx++)
     684    {   
     685      assert( cIdx < MAX_NUM_REF );   
     686      rpsCurrList[li][cIdx] = (*refPicSetInterLayer[1-li])[i];
     687      usedAsLongTerm [li][cIdx] = true; 
     688    }
     689
     690    assert(cIdx == numPocTotalCurr);
     691  }
     692}
     693
     694Void TComSlice::setRefPicList( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr )
     695
     696{
     697  if (!checkNumPocTotalCurr)
     698  {
     699    if (m_eSliceType == I_SLICE)
     700    {
     701      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     702      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     703
     704      return;
     705    }   
     706  }
     707
     708  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
     709
     710  for (Int li = 0; li < 2; li++)
     711  {
     712    if ( m_eSliceType == P_SLICE && li == 1 )
     713    {
     714      m_aiNumRefIdx[1] = 0;
     715      ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
     716    }
     717    else
     718    {
     719      for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)
     720      {
     721        Bool listModified             =                m_RefPicListModification.getRefPicListModificationFlagL( li );
     722        Int orgIdx                    = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr);
     723
     724        assert( rpsCurrList[li][ orgIdx ] != NULL );
     725        m_apcRefPicList    [li][rIdx] = rpsCurrList    [li][ orgIdx ];
     726        m_bIsUsedAsLongTerm[li][rIdx] = usedAsLongTerm [li][ orgIdx ] ;
     727      }
     728    }
     729  }
     730}
     731#endif
     732#else
     733#if H_MV
     734Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
     735#else
     736#if FIX1071
     737Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
     738#else
     739Void 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  }
    413782 
    414783  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
     
    458827    // 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:
    459828#if H_MV
    460     // 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.
    461     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     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.
    462831    if ( getRapPicFlag() && m_layerId == 0 )
    463832#else
    464     // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    465     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     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.
    466835    if (getRapPicFlag())
    467836#endif
     
    593962}
    594963
     964#endif
    595965Int TComSlice::getNumRpsCurrTempList()
    596966{
     
    609979  }
    610980#if H_MV
     981#if !H_MV5
    611982  assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() );
     983#endif
    612984  numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
    613985#endif
     
    9231295#if H_MV
    9241296  // Additional slice header syntax elements
     1297#if H_MV5
     1298  m_pocResetFlag               = pSrc->m_pocResetFlag;
     1299#endif
    9251300  m_discardableFlag            = pSrc->m_discardableFlag;
    9261301  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
     
    9311306    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
    9321307  }
    933  
     1308#if !H_MV5
    9341309  m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;
    9351310  m_altCollocatedIndicationFlag  = pSrc->m_altCollocatedIndicationFlag ;   
     
    9411316    m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];
    9421317  }
     1318#endif
    9431319#endif
    9441320#if H_3D_IC
     
    14051781: m_VPSId                     (  0)
    14061782, m_uiMaxTLayers              (  1)
     1783#if H_MV5
     1784#if H_MV
     1785, m_uiMaxLayersMinus1         (  0)
     1786#else
    14071787, m_uiMaxLayers               (  1)
     1788#endif
     1789#else
     1790, m_uiMaxLayers               (  1)
     1791#endif
    14081792, m_bTemporalIdNestingFlag    (false)
    14091793, m_numHrdParameters          (  0)
     
    14161800, m_hrdOpSetIdx               (NULL)
    14171801, m_cprmsPresentFlag          (NULL)
     1802#if H_MV5
     1803#if H_MV
     1804, m_vpsVUI                 (  NULL )
     1805#endif
     1806#endif
    14181807{
    14191808  for( Int i = 0; i < MAX_TLAYER; i++)
     
    14591848
    14601849  m_avcBaseLayerFlag = false;
     1850#if H_MV5
     1851  m_vpsVuiOffset     = 0;
     1852#endif
    14611853  m_splittingFlag    = false;
    14621854 
    14631855  for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ )
    14641856  {
     1857#if H_MV5
     1858    m_scalabilityMaskFlag[i] = false;
     1859#else
    14651860    m_scalabilityMask[i] = false;
     1861#endif
    14661862    m_dimensionIdLen [i]  = -1;
    14671863  }
     
    14891885    m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1;
    14901886    m_numDirectRefLayers[i] = 0;
     1887#if H_MV5
     1888    m_maxTidIlRefPicPlus1[i] = 7;
     1889    m_vpsRepFormatIdx    [i] = 0;
     1890    m_repFormat          [i] = NULL;
     1891    m_viewIdVal          [i] = 0;
     1892#else
    14911893    m_maxTidIlRefPicPlus1[i] = -1;
     1894#endif
     1895
    14921896#if H_3D
    14931897    m_viewIndex         [i] = -1;
     
    15101914    }
    15111915#endif
    1512 #if H_3D_TMVP
     1916#if H_3D
    15131917    m_ivMvScalingFlag = true;
    15141918#endif
     
    15311935#endif
    15321936  }
     1937#if H_MV5
     1938  m_vpsVUI = new TComVPSVUI;
     1939#endif
    15331940#if H_3D
    15341941  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    15561963  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
    15571964  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
     1965#if H_MV5
     1966#if H_MV
     1967  if ( m_vpsVUI          != NULL )     delete m_vpsVUI;
     1968  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     1969  {
     1970    if (m_repFormat[ i ] != NULL )      delete m_repFormat[ i ];   
     1971#if H_3D_DIM_DLT
     1972    if ( m_iDepthValue2Idx[i] != 0 )
     1973    {
     1974       xFree( m_iDepthValue2Idx[i] );
     1975       m_iDepthValue2Idx[i] = 0;
     1976    }
     1977
     1978    if ( m_iIdx2DepthValue[i] != 0 )
     1979    {
     1980      xFree( m_iIdx2DepthValue[i] );
     1981      m_iIdx2DepthValue[i] = 0;
     1982    }
     1983#endif
     1984  }
     1985#endif
     1986#else
    15581987#if H_3D_DIM_DLT
    15591988  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    15722001    }
    15732002  }
     2003#endif
    15742004#endif
    15752005}
     
    16422072Bool TComVPS::checkVPSExtensionSyntax()
    16432073{
     2074#if H_MV5
     2075  for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ )
     2076#else
    16442077  for( Int layer = 1; layer < getMaxLayers(); layer++ )
     2078#endif
    16452079  {
    16462080    // check layer_id_in_nuh constraint
     
    16582092{
    16592093  assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES );
     2094#if H_MV5
     2095  assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) );
     2096#else
    16602097  assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );
    1661 
     2098#endif
    16622099  Int scalIdx = 0;
    16632100  for( Int curScalType = 0; curScalType < scalType; curScalType++ )
    16642101  {
     2102#if H_MV5
     2103    scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 );
     2104#else
    16652105    scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );
     2106#endif
     2107
    16662108  }
    16672109
    16682110  return scalIdx;
    16692111}
    1670 
     2112#if H_MV5
     2113Void TComVPS::setScalabilityMaskFlag( UInt val )
     2114{
     2115  for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ )
     2116  {
     2117    setScalabilityMaskFlag( scalType, ( val & (1 << scalType ) ) != 0 );
     2118  }
     2119}
     2120#else
    16712121Void TComVPS::setScalabilityMask( UInt val )
    16722122{
     
    16752125}
    16762126
     2127#endif
     2128
     2129#if H_MV5
     2130Void TComVPS::setRefLayers()
     2131{
     2132  for( Int i = 0; i  <= getMaxLayersMinus1(); i++ )
     2133  {
     2134    Int iNuhLId = getLayerIdInNuh( i );
     2135    m_numDirectRefLayers[ iNuhLId ] = 0;
     2136    for( Int j = 0; j < i; j++ )
     2137    {
     2138      if( getDirectDependencyFlag(i , j) )
     2139      {
     2140        m_refLayerId[ iNuhLId ][m_numDirectRefLayers[ iNuhLId ]++ ] = getLayerIdInNuh( j );
     2141      }
     2142    }
     2143  }
     2144}
     2145
     2146Int TComVPS::getRefLayerId( Int layerIdInNuh, Int idx )
     2147{
     2148  assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInNuh] );     
     2149  Int refLayerIdInNuh = m_refLayerId[ layerIdInNuh ][ idx ];   
     2150  assert ( refLayerIdInNuh >= 0 );
     2151  return refLayerIdInNuh;
     2152}
     2153
     2154Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
     2155{
     2156  return getScalabilityMaskFlag( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
     2157}
     2158
     2159#if H_3D
     2160Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )
     2161{
     2162  Int foundLayerIdinNuh = -1;
     2163
     2164  for (Int layerIdInVps = 0 ; layerIdInVps <= getMaxLayersMinus1(); layerIdInVps++ )
     2165  {
     2166    Int layerIdInNuh = getLayerIdInNuh( layerIdInVps );
     2167    if( ( getViewIndex( layerIdInNuh ) == viewIndex ) && ( getDepthId( layerIdInNuh ) == ( depthFlag ? 1 : 0 ) )  )
     2168    {
     2169      foundLayerIdinNuh = layerIdInNuh;
     2170      break;
     2171    }
     2172  }
     2173  assert( foundLayerIdinNuh != -1 );
     2174
     2175  return foundLayerIdinNuh;
     2176}
     2177#endif // H_3D
     2178#else
    16772179Void TComVPS::setRefLayers()
    16782180{
     
    17932295}
    17942296
     2297#endif // H_MV5
     2298
    17952299
    17962300Int TComVPS::xGetDimBitOffset( Int j )
     
    18322336  return numLayersInIdList;
    18332337}
     2338#if H_MV5
     2339Int TComVPS::getNumViews()
     2340{
     2341  Int numViews = 1;
     2342  for( Int i = 0; i <=  getMaxLayersMinus1(); i++ )
     2343  {
     2344    Int lId = getLayerIdInNuh( i );
     2345    if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )
     2346    {
     2347      numViews++;
     2348    }   
     2349  }
     2350
     2351  return numViews;
     2352}
     2353
     2354Bool TComVPS::getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth /*= 0 */ )
     2355{
     2356  assert( depth < 65 );
     2357  Bool dependentFlag = getDirectDependencyFlag( depLayeridInVps, refLayeridInVps );
     2358
     2359  for( Int i = 0; i < depLayeridInVps && !dependentFlag; i++ )
     2360  {
     2361    if ( getDirectDependencyFlag( depLayeridInVps, i ) )
     2362    {
     2363      dependentFlag = getInDirectDependencyFlag( i, refLayeridInVps, depth++ );
     2364    }
     2365  }
     2366  return dependentFlag;
     2367}
     2368#endif
    18342369#endif // H_MV
    18352370
     
    18822417, m_vuiParameters             ()
    18832418#if H_MV
     2419#if H_MV5
     2420, m_pcVPS                     ( NULL )
     2421, m_spsInferScalingListFlag   ( false )
     2422, m_spsScalingListRefLayerId  ( 0 )
     2423, m_updateRepFormatFlag       ( true )
     2424, m_interViewMvVertConstraintFlag (false)
     2425#else
    18842426, m_interViewMvVertConstraintFlag (false)
    18852427, m_numIlpRestrictedRefLayers ( 0 )
     2428#endif
    18862429#endif
    18872430#if H_3D
     
    18982441  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    18992442  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
     2443#if !H_MV5
    19002444#if H_MV
    19012445  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    19052449    m_minHorizontalCtuOffsetPlus1 [ i ] = 0;
    19062450  }
     2451#endif
    19072452#endif
    19082453}
     
    20582603, m_listsModificationPresentFlag(  0)
    20592604, m_numExtraSliceHeaderBits(0)
     2605#if H_MV5
     2606#if H_MV
     2607, m_ppsInferScalingListFlag(false)
     2608, m_ppsScalingListRefLayerId(0)
     2609#endif
     2610#endif
    20602611{
    20612612  m_scalingList = new TComScalingList;
     
    20772628}
    20782629
     2630#if H_MV5
     2631#if H_MV
     2632Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr )
     2633{
     2634  if ( layerIdCurr > 0 )
     2635  {
     2636    TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
     2637    if ( !getUpdateRepFormatFlag() )
     2638    {       
     2639      setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
     2640      //// ToDo: add when supported:
     2641      // setSeperateColourPlaneFlag( repFormat->getSeparateColourPlaneVpsFlag() ) ;
     2642
     2643      setPicWidthInLumaSamples ( repFormat->getPicWidthVpsInLumaSamples()  );
     2644      setPicHeightInLumaSamples( repFormat->getPicHeightVpsInLumaSamples() );
     2645
     2646      setBitDepthY             ( repFormat->getBitDepthVpsLumaMinus8()   + 8 );
     2647      setQpBDOffsetY           ( (Int) (6*( getBitDepthY() - 8 )) );
     2648
     2649      setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
     2650      setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
     2651    }
     2652    else
     2653    {
     2654      assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         );
     2655      //// ToDo: add when supported:
     2656      // assert( getSeperateColourPlaneFlag() <=  repFormat->getSeparateColourPlaneVpsFlag() ) ;
     2657
     2658      assert( getPicWidthInLumaSamples()  <= repFormat->getPicWidthVpsInLumaSamples()    );
     2659      assert( getPicHeightInLumaSamples() <= repFormat->getPicHeightVpsInLumaSamples()   );
     2660
     2661      assert( getBitDepthY()              <= repFormat->getBitDepthVpsLumaMinus8()   + 8 );         
     2662      assert( getBitDepthC()              <= repFormat->getBitDepthVpsChromaMinus8() + 8 );
     2663    }
     2664  }
     2665
     2666  // Set conformance window
     2667  Int scal = TComSPS::getWinUnitX( getChromaFormatIdc() ) ;
     2668  getConformanceWindow().scaleOffsets( scal );
     2669  getVuiParameters()->getDefaultDisplayWindow().scaleOffsets( scal );
     2670}
     2671
     2672Void TComSPS::inferScalingList( TComSPS* spsSrc )
     2673{
     2674  if ( getSpsInferScalingListFlag() )
     2675  {
     2676    assert( spsSrc != NULL );
     2677    assert( !spsSrc->getSpsInferScalingListFlag() );             
     2678    getScalingList()->inferFrom( spsSrc->getScalingList() );
     2679  }
     2680}
     2681#endif
     2682#endif
    20792683#if H_3D
    20802684Void
     
    23462950
    23472951#if H_MV
    2348 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer )
    2349 {
    2350   refPicSetInterLayer.clear();
     2952#if H_MV5
     2953Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 )
     2954{
     2955  refPicSetInterLayer0.clear();
     2956  refPicSetInterLayer1.clear();
    23512957
    23522958  for( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
     
    23602966    picRef->getSlice(0)->setReferenced( true );       
    23612967
     2968    Int viewIdCur  = getVPS()->getViewId( getLayerId() );
     2969    Int viewIdZero = getVPS()->getViewId( 0 );
     2970    Int viewIdRef  = getVPS()->getViewId( layerIdRef );
     2971
     2972    if (  ( viewIdCur <= viewIdZero && viewIdCur <= viewIdRef ) || ( viewIdCur >= viewIdZero && viewIdCur >= viewIdRef ) )
     2973    {
     2974      refPicSetInterLayer0.push_back( picRef );
     2975    }
     2976    else
     2977    {
     2978      refPicSetInterLayer1.push_back( picRef );
     2979    }
     2980    // Consider to check here:
     2981    // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer0 and RefPicSetInterLayer1 that is a RASL picture. "   
     2982  }
     2983}
     2984#else
     2985Void 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
    23622999    // Consider to check here:
    23633000    // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. "
     
    23653002  }
    23663003}
    2367 
     3004#endif
     3005
     3006#if H_MV5
     3007Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
     3008{
     3009  // Mark as shortterm
     3010  for ( Int i = 0; i < refPicSetInterLayer0.size(); i++ )
     3011  {
     3012    refPicSetInterLayer0[i]->setIsLongTerm( false );
     3013  }
     3014
     3015  for ( Int i = 0; i < refPicSetInterLayer1.size(); i++ )
     3016  {
     3017    refPicSetInterLayer1[i]->setIsLongTerm( false );
     3018  }
     3019
     3020}
     3021#else
    23683022Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )
    23693023{
     
    23753029}
    23763030
     3031#endif
    23773032Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    23783033{
     
    23803035  if (targetDecLayerIdSet.size() == 0 )   
    23813036  {
     3037#if H_MV5
     3038    for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )
     3039#else
    23823040    for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )
     3041#endif
    23833042    {
    23843043      targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );
     
    23913050  {
    23923051    if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId )
     3052    {
    23933053      break;
     3054  }       
    23943055  }       
    23953056
     
    24073068          if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
    24083069          {
     3070#if H_MV5
     3071            for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
     3072            {
     3073              if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
     3074#else
    24093075            Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] );
    24103076            for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )
     3077            {
    24113078              if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS,  k  ) )
     3079#endif
     3080              {
    24123081                remainingInterLayerReferencesFlag = true;
    24133082          }
    24143083        }
     3084          }
     3085        }
    24153086        if( !remainingInterLayerReferencesFlag )
     3087        {
    24163088          pcPic->getSlice(0)->setReferenced( false );                   
    24173089      }
     
    24193091  }
    24203092}
    2421 
     3093}
     3094
     3095#if H_MV5
     3096Void TComSlice::printRefPicList()
     3097#else
    24223098Void TComSlice::xPrintRefPicList()
     3099#endif
    24233100
    24243101  for ( Int li = 0; li < 2; li++)
     
    24333110  }
    24343111}
     3112#if !H_MV5
    24353113Int TComSlice::xCeilLog2( Int val )
    24363114{
     
    24403118  return ceilLog2;
    24413119}
     3120#endif
    24423121
    24433122Void TComSlice::markCurrPic( TComPic* currPic )
     
    24543133}
    24553134
     3135#if H_MV5
     3136Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 )
     3137{
     3138  m_refPicSetInterLayer0 = refPicSetInterLayer0;
     3139  m_refPicSetInterLayer1 = refPicSetInterLayer1;
     3140}
     3141
     3142TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId )
     3143{
     3144  assert ( setIdc == 0 || setIdc == 1);   
     3145  std::vector<TComPic*>* refPicSetInterLayer = ( setIdc == 0 ? m_refPicSetInterLayer0 : m_refPicSetInterLayer1);   
     3146  assert( refPicSetInterLayer != 0 );
     3147 
     3148  TComPic* pcPic = NULL;
     3149  for ( Int i = 0; i < (*refPicSetInterLayer).size(); i++ )
     3150  {
     3151    if ((*refPicSetInterLayer)[ i ]->getLayerId() == layerId )
     3152    {
     3153      pcPic = (*refPicSetInterLayer)[ i ];
     3154    }
     3155  }
     3156
     3157  assert(pcPic != NULL);
     3158  return pcPic;
     3159}
     3160#else
    24563161Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )
    24573162{
     
    24743179  return pcPic;
    24753180}
    2476 
     3181#endif
    24773182Int TComSlice::getNumActiveRefLayerPics()
    24783183{
    24793184  Int numActiveRefLayerPics;
    24803185
     3186#if H_MV5
     3187  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) ==  0 )
     3188  {
     3189    numActiveRefLayerPics = 0;
     3190  }
     3191  else if (getVPS()->getAllRefLayersActiveFlag() )
     3192  {
     3193    numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() );
     3194  }
     3195  else if ( !getInterLayerPredEnabledFlag() )
     3196  {
     3197    numActiveRefLayerPics = 0;
     3198  }
     3199  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
     3200#else
    24813201  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) ==  0 || !getInterLayerPredEnabledFlag() )
    24823202  {
     
    24843204  }
    24853205  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )
     3206#endif
    24863207  {
    24873208    numActiveRefLayerPics = 1;
     
    24963217Int TComSlice::getRefPicLayerId( Int i )
    24973218{
     3219#if H_MV5
     3220  return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) );
     3221#else
    24983222  return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) );
    2499 }
    2500 
     3223#endif
     3224}
     3225
     3226#if !H_MV5
    25013227Void TComSlice::setActiveMotionPredRefLayers()
    25023228{
     
    25273253  return interRefEnabledInRPLFlag;
    25283254}
     3255#endif
    25293256#if H_3D_ARP
    25303257Void TComSlice::setARPStepNum()                                 
     
    28043531}
    28053532
     3533#if H_MV5
     3534#if H_MV
     3535Void TComScalingList::inferFrom( TComScalingList* srcScLi )
     3536{
     3537  for(Int sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     3538  {
     3539    for(Int listId = 0; listId <  g_scalingListNum[sizeId]; listId++)
     3540    {
     3541      setRefMatrixId  (sizeId,listId, srcScLi->getRefMatrixId  (sizeId,listId));
     3542      setScalingListDC(sizeId,listId, srcScLi->getScalingListDC(sizeId,listId));         
     3543      ::memcpy(getScalingListAddress(sizeId, listId),srcScLi->getScalingListAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
     3544    }
     3545  }
     3546}
     3547#endif
     3548#endif
    28063549/** initialization process of quantization matrix array
    28073550 */
     
    28933636, m_ppsMap(MAX_NUM_PPS)
    28943637, m_activeVPSId(-1)
     3638#if H_MV5
     3639#if !H_MV
    28953640, m_activeSPSId(-1)
    28963641, m_activePPSId(-1)
    28973642{
     3643#else
     3644{
     3645  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
     3646  {
     3647    m_activeSPSId[ i ] = -1;
     3648    m_activePPSId[ i ] = -1;
     3649  }
     3650#endif
     3651#else
     3652, m_activeSPSId(-1)
     3653, m_activePPSId(-1)
     3654{
     3655#endif
    28983656}
    28993657
     
    29053663//! activate a SPS from a active parameter sets SEI message
    29063664//! \returns true, if activation is successful
     3665#if H_MV5
     3666#if H_MV
     3667Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId )
     3668#else
    29073669Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
     3670#endif
     3671#else
     3672Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
     3673#endif
    29083674{
    29093675  TComSPS *sps = m_spsMap.getPS(spsId);
     
    29143680    {
    29153681      m_activeVPSId = vpsId;
     3682#if !H_MV5
    29163683      m_activeSPSId = spsId;
     3684#else
     3685#if H_MV
     3686      m_activeSPSId[ layerId ] = spsId;
     3687#else
     3688      m_activeSPSId = spsId;
     3689#endif
     3690#endif
    29173691      return true;
    29183692    }
     
    29313705//! activate a PPS and depending on isIDR parameter also SPS and VPS
    29323706//! \returns true, if activation is successful
     3707#if H_MV5
     3708#if H_MV
     3709Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId )
     3710#else
     3711Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
     3712#endif
     3713{
     3714  TComPPS *pps = m_ppsMap.getPS(ppsId);
     3715  if (pps)
     3716  {
     3717    Int spsId = pps->getSPSId();
     3718#if H_MV
     3719    if (!isIRAP && (spsId != m_activeSPSId[ layerId ]))
     3720#else
     3721    if (!isIRAP && (spsId != m_activeSPSId))
     3722#endif
     3723    {
     3724      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
     3725      return false;
     3726    }
     3727
     3728    TComSPS *sps = m_spsMap.getPS(spsId);
     3729    if (sps)
     3730    {
     3731      Int vpsId = sps->getVPSId();
     3732      if (!isIRAP && (vpsId != m_activeVPSId))
     3733      {
     3734        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
     3735        return false;
     3736      }
     3737      if (m_vpsMap.getPS(vpsId))
     3738      {
     3739#if H_MV
     3740        m_activePPSId[ layerId ] = ppsId;
     3741        m_activeVPSId = vpsId;
     3742        m_activeSPSId[ layerId ] = spsId;
     3743#else
     3744        m_activePPSId = ppsId;
     3745        m_activeVPSId = vpsId;
     3746        m_activeSPSId = spsId;
     3747#endif
     3748#else
    29333749Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
    29343750{
     
    29603776        m_activeVPSId = vpsId;
    29613777        m_activeSPSId = spsId;
     3778#endif
    29623779        return true;
    29633780      }
     
    30093826}
    30103827#endif
    3011 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    3012 TComBitRatePicRateInfo::TComBitRatePicRateInfo()
    3013 {
    3014   ::memset(m_bitRateInfoPresentFlag, 0, sizeof(m_bitRateInfoPresentFlag));
    3015   ::memset(m_picRateInfoPresentFlag, 0, sizeof(m_picRateInfoPresentFlag));
    3016   ::memset(m_avgBitRate,             0, sizeof(m_avgBitRate));
    3017   ::memset(m_maxBitRate,             0, sizeof(m_maxBitRate));
    3018   ::memset(m_constantPicRateIdc,     0, sizeof(m_constantPicRateIdc));
    3019   ::memset(m_avgPicRate,             0, sizeof(m_avgPicRate));
    3020 }
    3021 #endif
    30223828//! \}
     3829
     3830#if H_MV5
     3831#if H_MV
     3832TComVPSVUI::TComVPSVUI()
     3833{
     3834  m_bitRatePresentVpsFlag = false;
     3835  m_picRatePresentVpsFlag = false;
     3836  for ( Int i = 0; i < MAX_VPS_OP_SETS_PLUS1; i++)
     3837  {   
     3838    for ( Int j = 0; j < MAX_TLAYER; j++)
     3839    {   
     3840      m_bitRatePresentFlag          [i][j] = false;
     3841      m_picRatePresentFlag          [i][j] = false;
     3842      m_avgBitRate                  [i][j] = -1;
     3843      m_maxBitRate                  [i][j] = -1;
     3844      m_constantPicRateIdc          [i][j] = -1;
     3845      m_avgPicRate                  [i][j] = -1;
     3846    }
     3847  }
     3848
     3849  m_ilpRestrictedRefLayersFlag = false;
     3850
     3851  for ( Int i = 0; i < MAX_NUM_LAYERS; i++)
     3852  {         
     3853    for ( Int j = 0; j < MAX_NUM_LAYERS; j++)
     3854    {   
     3855      m_tileBoundariesAlignedFlag   [i][j] = false;
     3856      m_minSpatialSegmentOffsetPlus1[i][j] = 0;
     3857      m_ctuBasedOffsetEnabledFlag   [i][j] = false;
     3858      m_minHorizontalCtuOffsetPlus1 [i][j] = -1;
     3859    }
     3860  }
     3861}
     3862#endif
     3863#endif
Note: See TracChangeset for help on using the changeset viewer.