Changeset 798 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
10 Jun 2014, 01:10:15 (11 years ago)
Author:
qualcomm
Message:

JCTVC-P0041: Signalling and decoding of POC (Several macros)

The following macros describe the code each contains:

  1. POC_RESET_IDC_SIGNALLING - signalling of POC-related syntax elements
  2. POC_RESET_IDC_ENCODER - support for POC reset at encoder
  3. POC_RESET_IDC_DECODER - support for POC reset at decoder

In addition two bugfixes, under macros ALIGN_IRAP_BUGFIX and UNAVAILABLE_PIC_BUGFIX are also submitted.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-6-dev/source/Lib/TLibCommon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComPic.h

    r754 r798  
    9292  Int                   m_nFrameBit;
    9393#endif
    94 
     94#if POC_RESET_IDC_DECODER
     95  Bool                  m_currAuFlag;
     96#endif
    9597public:
    9698  TComPic();
     
    223225  Int   getFrameBit()         { return m_nFrameBit; }
    224226#endif
     227#if POC_RESET_IDC_DECODER
     228  Bool isCurrAu() { return m_currAuFlag; }
     229  Void setCurrAuFlag(Bool x) {m_currAuFlag = x; }
     230#endif
    225231};// END CLASS DEFINITION TComPic
    226232
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp

    r797 r798  
    125125, m_pocMsbValPresentFlag          ( false )
    126126#endif
     127#if POC_RESET_IDC_DECODER
     128, m_picOrderCntLsb (0)
     129#endif
    127130#endif //SVC_EXTENSION
    128131{
     
    200203  m_numEntryPointOffsets = 0;
    201204  m_enableTMVPFlag = true;
     205#if POC_RESET_IDC_SIGNALLING
     206  m_pocResetIdc                   = 0;
     207  m_pocResetPeriodId              = 0;
     208  m_fullPocResetFlag              = false;
     209  m_pocLsbVal                     = 0;
     210  m_pocMsbVal                     = 0;
     211  m_pocMsbValRequiredFlag         = false;
     212  m_pocMsbValPresentFlag          = false;
     213#endif
     214#if POC_RESET_IDC_DECODER
     215  m_picOrderCntLsb = 0;
     216#endif
    202217}
    203218
     
    223238}
    224239#endif
    225 
     240#if POC_RESET_IDC_DECODER
     241Bool TComSlice::getRaslPicFlag      ()
     242{
     243  return  getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R
     244  || getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N;
     245}
     246Bool TComSlice::getRadlPicFlag      ()
     247{
     248  return  getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
     249  || getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N;
     250}
     251#endif
     252#if POC_RESET_IDC_ENCODER
     253Void TComSlice::decrementRefPocValues(Int const decrementValue)
     254{
     255  for(Int listNum = 0; listNum < 2; listNum++)
     256  {
     257    RefPicList dpbPicSliceList = (listNum == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     258    for(Int listIdx = 0; listIdx < getNumRefIdx( dpbPicSliceList ); listIdx++)
     259    {
     260      setRefPOC( getRefPOC(dpbPicSliceList, listIdx) - decrementValue,
     261                  dpbPicSliceList,
     262                  listIdx
     263                  );
     264    }
     265  }
     266}
     267Int TComSlice::getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal )
     268{
     269  if( prevLsb - currLsb >= (maxLsbVal >> 1) )
     270  {
     271    return prevMsb + maxLsbVal;
     272  }
     273  else if( currLsb - prevLsb > (maxLsbVal >> 1) )
     274  {
     275    return prevMsb - maxLsbVal;
     276  }
     277  else
     278  {
     279    return prevMsb;
     280  }
     281}
     282#endif
    226283/**
    227284 - allocate table to contain substream sizes to be written to the slice header.
     
    279336  while ( iterPic != rcListPic.end() )
    280337  {
     338#if POC_RESET_IDC_ENCODER
     339    if( (pcPic->getPOC() == poc) && (pcPic->getSlice(0)->isReferenced()) )
     340#else
    281341    if(pcPic->getPOC() == poc)
     342#endif
    282343    {
    283344      break;
     
    293354    pcPic = *(iterPic);
    294355  }
    295 #if POC_RESET_FLAG
     356#if POC_RESET_FLAG || POC_RESET_IDC_DECODER
    296357  assert( pcPic->getSlice(0)->isReferenced() );
    297358#endif
     
    10871148      rpcPic->setCurrSliceIdx(0);
    10881149#if NO_CLRAS_OUTPUT_FLAG
     1150#if POC_RESET_IDC_ENCODER
    10891151      if (noClrasOutputFlag)
    10901152      {
     1153        rpcPic->getSlice(0)->setReferenced(false);  // all layers // TODO. This does not mark all layers
     1154      }
     1155      else
     1156      {
     1157        if (rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false);  // only current layer
     1158      }
     1159#else
     1160      if (noClrasOutputFlag)
     1161      {
    10911162        if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false);  // all layers
    10921163      }
     
    10951166        if (rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false);  // only current layer
    10961167      }
     1168#endif
    10971169#else
    10981170      if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false);
     
    11001172      iterPic++;
    11011173    }
     1174#if POC_RESET_IDC_ENCODER
     1175    this->getPic()->getSlice(0)->setReferenced(true);   // Mark the current picture back as refererced.
     1176#endif
    11021177    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    11031178      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     
    13281403}
    13291404
    1330 
     1405#if POC_RESET_IDC_ENCODER
     1406Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset)
     1407#else
    13311408Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic)
     1409#endif
    13321410{
    13331411  TComPic* rpcPic;
     
    14181496         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
    14191497      {
     1498#if POC_RESET_IDC_ENCODER
     1499        if( usePocBeforeReset )
     1500        {
     1501          assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset());
     1502        }
     1503        else
     1504        {
     1505          assert(rpcPic->getPOC() < this->getPOC());
     1506        }
     1507#else
    14201508        assert(rpcPic->getPOC() < this->getPOC());
     1509#endif
    14211510      }
    14221511    }
     
    14361525          if(this->getAssociatedIRAPPOC() != rpcPic->getPOC())
    14371526          {
     1527#if POC_RESET_IDC_ENCODER
     1528            if( usePocBeforeReset )
     1529            {
     1530              assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset());
     1531            }
     1532            else
     1533            {
     1534              assert(rpcPic->getPOC() < this->getPOC());
     1535            }
     1536#else
    14381537            assert(rpcPic->getPOC() < this->getPOC());
     1538#endif
    14391539          }
    14401540        }
     
    14531553        // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB
    14541554        // rpcPic would violate the constraint if it was a trailing picture
     1555#if POC_RESET_IDC_ENCODER
     1556        if( usePocBeforeReset )
     1557        {
     1558          assert(rpcPic->getPOC() <= this->getAssociatedIrapPocBeforeReset());
     1559        }
     1560        else
     1561        {
     1562          assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC());
     1563        }
     1564#else
    14551565        assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC());
     1566#endif
    14561567      }
    14571568    }
     
    17591870    if(isAvailable == 0)   
    17601871    {           
     1872#if UNAVAILABLE_PIC_BUGFIX
     1873#if 0
    17611874      if (this->getPOC() + pReferencePictureSet->getDeltaPOC(i) >= pocRandomAccess)
     1875#endif
     1876#endif
    17621877      {
    17631878        if(!pReferencePictureSet->getUsed(i) )
     
    17801895      }
    17811896#if ALLOW_RECOVERY_POINT_AS_RAP
     1897#if UNAVAILABLE_PIC_BUGFIX
     1898      if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1899#else
    17821900      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1901#endif
    17831902      {
    17841903        atLeastOneUnabledByRecoveryPoint = 1;
     
    37613880    return false;
    37623881  }       
    3763 #if POC_RESET_FLAG
     3882#if POC_RESET_FLAG || POC_RESET_IDC_DECODER
     3883#if POC_RESET_IDC_DECODER
     3884  TComPic* pic = xGetRefPic( rcListPic, getPOC() );
     3885#else
    37643886  TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC );
     3887#endif
    37653888
    37663889  if( pic )
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h

    r796 r798  
    19681968  Int         m_iLastIDR;
    19691969  Int         m_iAssociatedIRAP;
     1970#if POC_RESET_IDC_ENCODER
     1971  Int                     m_associatedIrapPocBeforeReset;
     1972#endif
     1973
    19701974  NalUnitType m_iAssociatedIRAPType;
    19711975  static Int  m_prevTid0POC;
     
    20942098  Bool        m_pocMsbValPresentFlag;
    20952099#endif
     2100#if POC_RESET_IDC_ENCODER
     2101  Int         m_pocValueBeforeReset;
     2102#endif
     2103#if POC_RESET_IDC_DECODER
     2104  Int         m_picOrderCntLsb;
     2105#endif
    20962106#if Q0048_CGS_3D_ASYMLUT
    20972107  Int        m_nCGSOverWritePPS;  // for optimization, not output to bitstream
     
    21392149    Void     adjustPrevTid0POC      (Int adj)             { m_prevTid0POC=m_prevTid0POC-adj; }
    21402150#endif
     2151#if POC_RESET_IDC_DECODER
     2152  Void      setPrevTid0POC( Int x ) { m_prevTid0POC = x; }
     2153#endif
     2154
    21412155  TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; }
    21422156  Void      setLastIDR(Int iIDRPOC)                       { m_iLastIDR = iIDRPOC; }
     
    21442158  Void      setAssociatedIRAPPOC(Int iAssociatedIRAPPOC)             { m_iAssociatedIRAP = iAssociatedIRAPPOC; }
    21452159  Int       getAssociatedIRAPPOC()                        { return m_iAssociatedIRAP; }
     2160#if POC_RESET_IDC_ENCODER
     2161  Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; }
     2162  Int  getAssociatedIrapPocBeforeReset(     ) { return m_associatedIrapPocBeforeReset; }
     2163#endif
     2164
    21462165  Void      setAssociatedIRAPType(NalUnitType associatedIRAPType)    { m_iAssociatedIRAPType = associatedIRAPType; }
    21472166  NalUnitType getAssociatedIRAPType()                        { return m_iAssociatedIRAPType; }
     
    22532272  Void setTLayerInfo( UInt uiTLayer );
    22542273  Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
     2274#if POC_RESET_IDC_ENCODER
     2275  Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false);
     2276#else
    22552277  Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic );
     2278#endif
    22562279  Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
    22572280  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
     
    24512474  Bool      getCraPicFlag       ();
    24522475#endif
     2476#if POC_RESET_IDC_DECODER
     2477  Bool      getRaslPicFlag      ();
     2478  Bool      getRadlPicFlag      ();
     2479  Int       getPicOrderCntLsb() { return m_picOrderCntLsb; }
     2480  Void      setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; }
     2481#endif
     2482
     2483#if POC_RESET_IDC_ENCODER
     2484  Int       getPocValueBeforeReset ()                        { return m_pocValueBeforeReset; }
     2485  Void      setPocValueBeforeReset (Int x)                   { m_pocValueBeforeReset = x ;   }
     2486  Void      decrementRefPocValues(Int const decrementValue);
     2487  Int       getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal );
     2488#endif
     2489
    24532490
    24542491#endif //SVC_EXTENSION
  • branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h

    r797 r798  
    9797#define O0194_WEIGHTED_PREDICTION_CGS    1      ///< JCTVC-O0194: Weighted prediciton for color gamut scalability
    9898#endif
    99 #define POC_RESET_FLAG                   1      ///< JCTVC-N0244: POC reset flag for  layer pictures.
     99#define POC_RESET_FLAG                   0      ///< JCTVC-N0244: POC reset flag for  layer pictures.
    100100#define POC_RESET_IDC                    1      ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG
    101101#if POC_RESET_IDC
    102102#define POC_RESET_IDC_SIGNALLING         1      ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements
     103#define POC_RESET_IDC_ENCODER            1      ///< JCTVC-P0041: Include support of enabling POC reset at the encoder
     104#define POC_RESET_IDC_DECODER            1      ///< JCTVC-P0041: Include support of enabling POC reset at the decoder
     105#define ALIGN_IRAP_BUGFIX               1
     106#define UNAVAILABLE_PIC_BUGFIX          1
    103107#endif
    104108#define POC_MSB_VAL_PRESENT_FLAG_SEM     1      ///< JCTVC-Q0146: Inference of poc_msb_val_present_flag
Note: See TracChangeset for help on using the changeset viewer.