Ignore:
Timestamp:
8 Oct 2013, 08:00:50 (11 years ago)
Author:
qualcomm
Message:

JCTVC-N0244: Signaling of poc_reset_flag in the slice header (MACRO: POC_RESET_FLAG)

Signal poc_reset_flag in slice header, which will reset POC value of the current picture and decrement the POC of pictures in the DPB.

From: Adarsh K. Ramasubramonian <aramasub@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r410 r411  
    647647
    648648#if SVC_EXTENSION
     649#if POC_RESET_FLAG
     650Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )
     651#else
    649652Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )
     653#endif
    650654#else
    651655Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
     
    780784  }
    781785  m_bFirstSliceInSequence = false;
     786#if POC_RESET_FLAG
     787  // This operation would do the following:
     788  // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
     789  // 2. Update the value of m_pocCRA.
     790  // 3. Reset the POC values at the decoder for the current picture to be zero.
     791  // 4. update value of POCLastDisplay
     792  if( m_apcSlicePilot->getPocResetFlag() )
     793  {
     794    if( m_apcSlicePilot->getSliceIdx() == 0 )
     795    {
     796      Int pocAdjustValue = m_apcSlicePilot->getPOC();
     797
     798      // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre
     799      TComList<TComPic*>::iterator  iterPic = m_cListPic.begin(); 
     800
     801      // Iterate through all picture in DPB
     802      while( iterPic != m_cListPic.end() )
     803      {
     804        TComPic *dpbPic = *iterPic;
     805        // Check if the picture pointed to by iterPic is either used for reference or
     806        // needed for output, are in the same layer, and not the current picture.
     807        if( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
     808            &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() )
     809              && ( dpbPic->getReconMark() )
     810          )
     811        {
     812          for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
     813          {
     814
     815            TComSlice *slice = dpbPic->getSlice(i);
     816            TComReferencePictureSet *rps = slice->getRPS();
     817            slice->setPOC( slice->getPOC() - pocAdjustValue );
     818
     819            // Also adjust the POC value stored in the RPS of each such slice
     820            for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
     821            {
     822              rps->setPOC( j, rps->getPOC(j) - pocAdjustValue );
     823            }
     824            // Also adjust the value of refPOC
     825            for(Int k = 0; k < 2; k++)  // For List 0 and List 1
     826            {
     827              RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     828              for(Int j = 0; j < slice->getNumRefIdx(list); j++)
     829              {
     830                slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j);
     831              }
     832            }
     833          }
     834        }
     835        iterPic++;
     836      }
     837      // Update the value of pocCRA
     838      m_pocCRA -= pocAdjustValue;
     839      // Update value of POCLastDisplay
     840      iPOCLastDisplay -= pocAdjustValue;
     841    }
     842    // Reset current poc for current slice and RPS
     843    m_apcSlicePilot->setPOC( 0 );
     844  }
     845#endif
    782846  //detect lost reference picture and insert copy of earlier frame.
    783847  Int lostPoc;
Note: See TracChangeset for help on using the changeset viewer.