Changeset 411 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
8 Oct 2013, 08:00:50 (12 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@…>

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

Legend:

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

    r409 r411  
    14391439  if(!rpcSlice->getDependentSliceSegmentFlag())
    14401440  {
    1441 
     1441#if POC_RESET_FLAG
     1442    Int i = 0;
     1443    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > i)
     1444    {
     1445      READ_FLAG(uiCode, "poc_reset_flag");      rpcSlice->setPocResetFlag( uiCode ? true : false );
     1446      i++;
     1447    }
     1448    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > i)
     1449    {
     1450      READ_FLAG(uiCode, "discardable_flag"); // ignored
     1451      i++;
     1452    }
     1453    for (; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     1454    {
     1455      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
     1456    }
     1457#else
    14421458#if SH_DISCARDABLE_FLAG
    14431459    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0)
     
    14541470      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    14551471    }
     1472#endif
    14561473#endif
    14571474
  • 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;
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h

    r389 r411  
    229229  Void      xActivateParameterSets();
    230230#if SVC_EXTENSION
     231#if POC_RESET_FLAG
     232  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
     233#else
    231234  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
     235#endif
    232236#else
    233237  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.