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


Ignore:
Timestamp:
10 Oct 2014, 18:22:03 (11 years ago)
Author:
nokia
Message:

Integration of JCTVC-P0297 (poc_lsb_aligned_flag)

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

Legend:

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

    r902 r903  
    20332033  READ_FLAG(uiCode, "max_one_active_ref_layer_flag" );
    20342034  vps->setMaxOneActiveRefLayerFlag(uiCode);
     2035#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     2036  READ_FLAG(uiCode, "vps_poc_lsb_aligned_flag");
     2037  vps->setVpsPocLsbAlignedFlag(uiCode);
     2038#endif
    20352039#if O0062_POC_LSB_NOT_PRESENT_FLAG
    20362040  for(i = 1; i< vps->getMaxLayers(); i++)
     
    22282232  }
    22292233
    2230   // vps_poc_lsb_aligned_flag
    2231   // When not present, vps_poc_lsb_aligned_flag is inferred to be equal to 0.
     2234#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     2235  vps->setVpsPocLsbAlignedFlag(false);
     2236#endif
    22322237
    22332238#if O0062_POC_LSB_NOT_PRESENT_FLAG
     
    38923897
    38933898  // Derive the value of PocMsbValRequiredFlag
    3894   rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()
    3895     /* || related to vps_poc_lsb_aligned_flag */
    3896     );
    3897 
    3898   if( !rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ )
    3899   {
    3900     READ_FLAG( uiCode,    "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag( uiCode ? true : false );
     3899#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     3900  rpcSlice->setPocMsbValRequiredFlag( (rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag())
     3901                                      && (!rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() ||
     3902                                         (rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() && rpcSlice->getVPS()->getNumDirectRefLayers(rpcSlice->getLayerId()) == 0))
     3903                                    );
     3904#else
     3905  rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() );
     3906#endif
     3907
     3908#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     3909  if (!rpcSlice->getPocMsbValRequiredFlag() && rpcSlice->getVPS()->getVpsPocLsbAlignedFlag())
     3910#else
     3911  if (!rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */)
     3912#endif
     3913  {
     3914#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     3915    READ_FLAG(uiCode, "poc_msb_cycle_val_present_flag"); rpcSlice->setPocMsbValPresentFlag(uiCode ? true : false);
     3916#else
     3917    READ_FLAG(uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag(uiCode ? true : false);
     3918#endif
    39013919  }
    39023920  else
     
    39253943  if( rpcSlice->getPocMsbValPresentFlag() )
    39263944  {
     3945#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     3946    READ_UVLC( uiCode,    "poc_msb_cycle_val");             rpcSlice->setPocMsbVal( uiCode );
     3947#else
    39273948    READ_UVLC( uiCode,    "poc_msb_val");             rpcSlice->setPocMsbVal( uiCode );
     3949#endif
    39283950
    39293951#if !POC_RESET_IDC_DECODER
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r901 r903  
    120120  resetPocRestrictionCheckParameters();
    121121#endif
     122#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     123  m_pocResettingFlag        = false;
     124  m_pocDecrementedInDPBFlag = false;
     125#endif
    122126}
    123127
     
    11761180  }
    11771181#endif
     1182
    11781183#if POC_RESET_IDC_DECODER
    11791184  if( m_parseIdc != -1 ) // Second pass for a POC resetting picture
     
    12011206#endif
    12021207      markAllPicsAsNoCurrAu();
    1203     }
     1208#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1209      for (UInt i = 0; i < MAX_LAYERS; i++)
     1210      {
     1211        m_ppcTDecTop[i]->m_pocDecrementedInDPBFlag = false;
     1212      }
     1213#endif
     1214    }
     1215
     1216
     1217#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1218    m_pocResettingFlag = false;
     1219
     1220    if (m_apcSlicePilot->getPocResetIdc() != 0)
     1221    {
     1222      if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
     1223      {
     1224        m_pocResettingFlag = true;
     1225      }
     1226      else if (m_pocDecrementedInDPBFlag)
     1227      {
     1228        m_pocResettingFlag = false;
     1229      }
     1230      else
     1231      {
     1232        m_pocResettingFlag = true;
     1233      }
     1234    }
     1235#endif
    12041236
    12051237    if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 )
     
    12491281#if ALIGNED_BUMPING
    12501282#if POC_RESET_IDC_DECODER
     1283
     1284#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1285  UInt affectedLayerList[MAX_NUM_LAYER_IDS];
     1286  Int  numAffectedLayers;
     1287
     1288  affectedLayerList[0] = m_apcSlicePilot->getLayerId();
     1289  numAffectedLayers = 1;
     1290
     1291  if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
     1292  {
     1293    for (UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++)
     1294    {
     1295      affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);
     1296    }
     1297    numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;
     1298  }
     1299#endif
     1300
    12511301  //if(  (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) )
    1252   if( m_parseIdc == 1 )
     1302#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1303  if (m_parseIdc == 1 && m_pocResettingFlag)
     1304#else
     1305  if (m_parseIdc == 1)
     1306#endif
    12531307  {
    12541308    // Invoke output of pictures if the current picture is a POC reset picture
     
    13011355    Int deltaPocVal  =  pocMsbDelta + pocLsbDelta;
    13021356
     1357#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1358    for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++)
     1359    {
     1360      if (!m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag)
     1361      {
     1362        m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag = true;
     1363        TComList<TComPic*>::iterator  iterPic = m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->begin();
     1364        while (iterPic != m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->end())
     1365#else
    13031366    //Reset all POC for DPB -> basically do it for each slice in the picutre
    13041367    TComList<TComPic*>::iterator  iterPic = m_cListPic.begin(); 
     
    13061369    // Iterate through all picture in DPB
    13071370    while( iterPic != m_cListPic.end() )
     1371#endif
    13081372    {
    13091373      TComPic *dpbPic = *iterPic;
    13101374      // Check if the picture pointed to by iterPic is either used for reference or
    13111375      // needed for output, are in the same layer, and not the current picture.
    1312       if( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
     1376#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1377      assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]);
     1378      if ( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) )
     1379#else
     1380      if ( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
    13131381          &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() )
    13141382            && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() ))
     1383#endif
    13151384      {
    13161385        for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
     
    13391408      iterPic++;
    13401409    }
     1410#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1411        // Update the value of pocCRA
     1412        m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocCRA -= deltaPocVal;
     1413      }
     1414    }
     1415#else
    13411416    // Update the value of pocCRA
    13421417    m_pocCRA -= deltaPocVal;
     1418#endif
    13431419
    13441420    // Update value of POCLastDisplay
     
    13481424  Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb();
    13491425
    1350   if( m_parseIdc == 1 || m_parseIdc == 2 ) // TODO This should be replaced by pocResettingFlag.
     1426#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1427  if (m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2))
     1428#else
     1429  if (m_parseIdc == 1 || m_parseIdc == 2) // TODO This should be replaced by pocResettingFlag.
     1430#endif
    13511431  {
    13521432    // Set poc for current slice
     
    13941474        && !m_apcSlicePilot->getDiscardableFlag() )
    13951475    {
     1476#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1477      for (UInt i = 0; i < numAffectedLayers; i++)
     1478      {
     1479        m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt(m_apcSlicePilot->getPOC());
     1480      }
     1481#else
    13961482      this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() );
     1483#endif
    13971484    }
    13981485    else if ( m_apcSlicePilot->getPocResetIdc() == 3 )
    13991486    {
     1487#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1488      if (!m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag))
     1489      {
     1490        for (UInt i = 0; i < numAffectedLayers; i++)
     1491        {
     1492          m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag()
     1493                                                                  ? 0 : m_apcSlicePilot->getPocLsbVal() );
     1494        }
     1495      }
     1496#else
    14001497      this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag()
    14011498                                            ? 0 : m_apcSlicePilot->getPocLsbVal() );
     1499#endif
    14021500    }
    14031501#else
     
    23122410  //  Decode a picture
    23132411  m_cGopDecoder.decompressSlice(nalu.m_Bitstream, pcPic);
     2412
     2413#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     2414  setFirstPicInLayerDecodedFlag(true);
     2415#endif
    23142416
    23152417  m_bFirstSliceInPicture = false;
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r856 r903  
    127127  UInt                    m_numLayer;
    128128  TDecTop**               m_ppcTDecTop;
     129#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     130  Bool                    m_pocResettingFlag;
     131  Bool                    m_pocDecrementedInDPBFlag;
     132#endif
    129133#if AVC_BASE
    130134  fstream*                m_pBLReconFile;
Note: See TracChangeset for help on using the changeset viewer.