Changeset 1522 in SHVCSoftware for branches


Ignore:
Timestamp:
27 Jan 2016, 19:19:24 (9 years ago)
Author:
seregin
Message:

move temporal layer conditions to conformance bitstream checks to match the spec, it also solves segmentation fault from the ticket #94

Location:
branches/SHM-dev/source/Lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1512 r1522  
    464464  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
    465465#if SVC_EXTENSION
    466   Int numInterLayerRPSPics = 0;
    467466  if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )
    468467  {
    469     for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ )
    470     {
    471       Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[i]->getSlice(0)->getLayerIdx(), getLayerIdx());
    472 
    473       if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) )
    474       {
    475         numInterLayerRPSPics++;
    476 
    477         assert( ilpPic[i]->getSlice(0)->getDiscardableFlag() == 0 );    // Inter-layer RPS shall not contain picture with discardable_flag = 1.
    478       }
    479     }
    480     if (numInterLayerRPSPics < m_activeNumILRRefIdx)
    481     {
    482       m_activeNumILRRefIdx = numInterLayerRPSPics;
    483     }
    484 
    485468    // max one resampling direct layer
    486469    if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) )
     
    587570    if( m_layerId > 0 )
    588571    {     
    589       for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPicTotalCurr; cIdx ++, i ++)     
     572      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPicTotalCurr; cIdx++, i++ )     
    590573      {
    591574        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    592         Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx());
    593         if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
    594         {
    595           rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
    596         }
     575        Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx());
     576
     577        // SHM: ILP is not valid due to temporal layer restriction, bitstream is not conformant
     578        assert( Int(ilpPic[refLayerIdc]->getSlice(0)->getTLayer()) < maxTidIlRefPicsPlus1 || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) );
     579
     580        // SHM: Inter-layer RPS shall not contain picture with discardable_flag = 1.
     581        assert( ilpPic[refLayerIdc]->getSlice(0)->getDiscardableFlag() == 0 );
     582
     583        rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
    597584      }
    598585    }
     
    628615    if( m_layerId > 0 )
    629616    {
    630       for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPicTotalCurr; cIdx ++, i ++)
     617      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPicTotalCurr; cIdx++, i++ )
    631618      {
    632619        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    633         Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx() );
    634         if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
    635         {
    636           rpsCurrList1[cIdx] = ilpPic[refLayerIdc];
    637         }
     620        Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx() );
     621
     622        // SHM: ILP is not valid due to temporal layer restriction, bitstream is not conformant
     623        assert( Int(ilpPic[refLayerIdc]->getSlice(0)->getTLayer()) < maxTidIlRefPicsPlus1 || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) );
     624
     625        // SHM: Inter-layer RPS shall not contain picture with discardable_flag = 1.
     626        assert( ilpPic[refLayerIdc]->getSlice(0)->getDiscardableFlag() == 0 );
     627
     628        rpsCurrList1[cIdx] = ilpPic[refLayerIdc];
    638629      }
    639630    }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1515 r1522  
    16061606      Int   numRefLayerPics = 0;
    16071607      Int   i = 0;
    1608       Int   refLayerPicIdc  [MAX_VPS_LAYER_IDX_PLUS1];
     1608      Int   refLayerPicIdc[MAX_VPS_LAYER_IDX_PLUS1];
    16091609      for(i = 0, numRefLayerPics = 0;  i < pcSlice->getNumILRRefIdx(); i++ )
    16101610      {
    16111611        if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
    1612               vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >=  pcSlice->getTLayer() )
    1613         {         
     1612              vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >= pcSlice->getTLayer() )
     1613        {
    16141614          refLayerPicIdc[ numRefLayerPics++ ] = i;
    16151615        }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1512 r1522  
    16081608        // Apply temporal layer restriction to inter-layer prediction
    16091609        Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerIdx(), pcSlice->getLayerIdx());
    1610         if( ((Int)(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getRapPicFlag()) )
     1610        if( ((Int)(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getTLayer()) < maxTidIlRefPicsPlus1) || (maxTidIlRefPicsPlus1==0 && pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getRapPicFlag()) )
    16111611        {
    16121612          interLayerPredLayerIdcTmp[activeNumILRRefIdxTmp++] = refLayerIdc; // add picture to the list of valid inter-layer pictures
     
    16141614        else
    16151615        {
    1616           continue; // ILP is not valid due to temporal layer restriction
     1616          continue; // SHM: ILP is not valid due to temporal layer restriction
    16171617        }
    16181618
Note: See TracChangeset for help on using the changeset viewer.