Changeset 815 in SHVCSoftware for trunk/source/App/TAppDecoder/TAppDecTop.cpp


Ignore:
Timestamp:
30 Jun 2014, 06:13:06 (10 years ago)
Author:
seregin
Message:

merge with SHM-6-dev branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r713 r815  
    191191    InputNALUnit nalu;
    192192    byteStreamNALUnit(bytestream, nalUnit, stats);
    193 
    194193    // call actual decoding function
    195194    Bool bNewPicture = false;
     
    215214      {
    216215        bNewPicture = m_acTDecTop[nalu.m_layerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_layerId], curLayerId, bNewPOC);
     216#if POC_RESET_IDC_DECODER
     217        if ( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) )
     218#else
    217219        if (bNewPicture)
     220#endif
    218221        {
    219222          bitstreamFile.clear();
     
    225228          bytestream.reset();
    226229        }
    227       }
    228     }
    229 
     230#if POC_RESET_IDC_DECODER
     231        else if(m_acTDecTop[nalu.m_layerId].getParseIdc() == 1)
     232        {
     233          bitstreamFile.clear();
     234          // This is before third parse of the NAL unit, and
     235          // location points to correct beginning of the NALU
     236          bitstreamFile.seekg(location);
     237          bytestream.reset();
     238        }
     239#endif
     240      }
     241    }
     242
     243#if POC_RESET_IDC_DECODER
     244    if ((bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
     245#else
    230246    if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
     247#endif
    231248    {
    232249#if O0194_DIFFERENT_BITDEPTH_EL_BL
     
    245262    }
    246263
     264#if POC_RESET_IDC_DECODER
     265    if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 )
     266    {
     267      outputAllPictures( nalu.m_layerId, true );
     268    }
     269#endif
     270
    247271    if( pcListPic )
    248272    {
     
    269293        flushAllPictures( nalu.m_layerId, outputPicturesFlag );       
    270294      }
     295
     296#if POC_RESET_IDC_DECODER
     297      if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() != 0 )
     298      // New picture, slice header parsed but picture not decoded
     299#else
    271300      if( bNewPicture ) // New picture, slice header parsed but picture not decoded
     301#endif
    272302      {
    273303#if NO_OUTPUT_OF_PRIOR_PICS
     
    12351265
    12361266    // Find the status of the DPB
     1267#if POC_RESET_IDC_DECODER
     1268    xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus, false);
     1269#else
    12371270    xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus);
     1271#endif
    12381272
    12391273    while( dpbStatus.m_numAUsNotDisplayed )
     
    12821316  // Find DPB-information from the VPS
    12831317  DpbStatus maxDpbLimit;
     1318#if RESOLUTION_BASED_DPB
    12841319  Int targetLsIdx, subDpbIdx;
    12851320  TComVPS *vps = findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit);
     1321
    12861322  if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    12871323  {
     
    12941330    subDpbIdx   = vps->getSubDpbAssigned( targetLsIdx, layerIdx );
    12951331  }
     1332#else
     1333  Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ? 0 : layerIdx;
     1334  findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit);
     1335#endif
    12961336  // Assume that listOfPocs is sorted in increasing order - if not have to sort it.
    12971337  while( ifInvokeBumpingBeforeDecoding(dpbStatus, maxDpbLimit, layerIdx, subDpbIdx) )
     
    14371477    for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++)
    14381478    {
     1479#if RESOUTION_BASED_DPB
    14391480      maxDpbLimit.m_numPicsInLayer[i] = vps->getMaxVpsLayerDecPicBuffMinus1( targetOutputLsIdx, i, highestTId ) + 1;
    14401481      maxDpbLimit.m_numPicsInSubDpb[vps->getSubDpbAssigned( targetLsIdx, i )] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, vps->getSubDpbAssigned( targetLsIdx, i ), highestTId) + 1;
     1482#else
     1483      maxDpbLimit.m_numPicsInSubDpb[i] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, i, highestTId) + 1;
     1484#endif
    14411485    }
    14421486    // -------------------------------------
     
    14721516  retVal |= ( dpbStatus.m_numPicsInSubDpb[subDpbIdx] >= dpbLimit.m_numPicsInSubDpb[subDpbIdx] );
    14731517 
     1518#if RESOLUTION_BASED_DPB
    14741519  // Number of pictures in each layer
    14751520  retVal |= ( dpbStatus.m_numPicsInLayer[layerIdx] >= dpbLimit.m_numPicsInLayer[layerIdx]);
     1521#endif
    14761522
    14771523  return retVal;
     
    14921538                            , std::vector<Int> *listOfPocsPositionInEachLayer
    14931539                            , DpbStatus &dpbStatus
     1540#if POC_RESET_IDC_DECODER
     1541                            , Bool notOutputCurrAu
     1542#endif
    14941543                            )
    14951544{
     
    15161565          vps = pic->getSlice(0)->getVPS();
    15171566        }
    1518 
    1519         std::vector<Int>::iterator it;
    1520         if( pic->getOutputMark() ) // && pic->getPOC() > m_aiPOCLastDisplay[i])
    1521         {
    1522           it = find( listOfPocs.begin(), listOfPocs.end(), pic->getPOC() ); // Check if already included
    1523           if( it == listOfPocs.end() )  // New POC value - i.e. new AU - add to the list
     1567#if POC_RESET_IDC_DECODER
     1568        if( !(pic->isCurrAu() && notOutputCurrAu ) )
     1569        {
     1570#endif
     1571          std::vector<Int>::iterator it;
     1572          if( pic->getOutputMark() ) // && pic->getPOC() > m_aiPOCLastDisplay[i])
    15241573          {
    1525             listOfPocs.push_back( pic->getPOC() );
     1574            it = find( listOfPocs.begin(), listOfPocs.end(), pic->getPOC() ); // Check if already included
     1575            if( it == listOfPocs.end() )  // New POC value - i.e. new AU - add to the list
     1576            {
     1577              listOfPocs.push_back( pic->getPOC() );
     1578            }
     1579            listOfPocsInEachLayer         [i].push_back( pic->getPOC()    );    // POC to be output in each layer
     1580            listOfPocsPositionInEachLayer [i].push_back( picPositionInList  );  // For ease of access
    15261581          }
    1527           listOfPocsInEachLayer         [i].push_back( pic->getPOC()    );    // POC to be output in each layer
    1528           listOfPocsPositionInEachLayer [i].push_back( picPositionInList  );  // For ease of access
    1529         }
    1530         if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() )
    1531         {
    1532           dpbStatus.m_numPicsInLayer[i]++;  // Count pictures that are "used for reference" or "needed for output"
    1533         }
     1582          if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() )
     1583          {
     1584            dpbStatus.m_numPicsInLayer[i]++;  // Count pictures that are "used for reference" or "needed for output"
     1585          }
     1586#if POC_RESET_IDC_DECODER
     1587        }
     1588#endif
    15341589      }
    15351590      iterPic++;
     
    15501605  {
    15511606    dpbStatus.m_numPicsNotDisplayedInLayer[i] = listOfPocsInEachLayer[i].size();
     1607#if RESOLUTION_BASED_DPB
    15521608    dpbStatus.m_numPicsInSubDpb[vps->getSubDpbAssigned(targetLsIdx,i)] += dpbStatus.m_numPicsInLayer[i];
     1609#else
     1610    dpbStatus.m_numPicsInSubDpb[i] += dpbStatus.m_numPicsInLayer[i];
     1611#endif
    15531612  }
    15541613  assert( dpbStatus.m_numAUsNotDisplayed != -1 );
    1555 
    1556 
    15571614
     1615
     1616#if POC_RESET_IDC_DECODER
     1617Void TAppDecTop::outputAllPictures(Int layerId, Bool notOutputCurrPic)
     1618{
     1619  { // All pictures in the DPB in that layer are to be output; this means other pictures would also be output
     1620    std::vector<Int>  listOfPocs;
     1621    std::vector<Int>  listOfPocsInEachLayer[MAX_LAYERS];
     1622    std::vector<Int>  listOfPocsPositionInEachLayer[MAX_LAYERS];
     1623    DpbStatus dpbStatus;
     1624
     1625    // Find the status of the DPB
     1626    xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus, notOutputCurrPic);
     1627
     1628    if( listOfPocs.size() )
     1629    {
     1630      while( listOfPocsInEachLayer[layerId].size() )    // As long as there picture in the layer to be output
     1631      {
     1632        bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus );
     1633      }
     1634    }
     1635  }
     1636}
     1637#endif
    15581638#endif
    15591639//! \}
Note: See TracChangeset for help on using the changeset viewer.