Ignore:
Timestamp:
7 Apr 2014, 23:08:52 (11 years ago)
Author:
seregin
Message:

update to HM-14.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp

    r644 r652  
    7575, m_pcPic                         ( NULL )
    7676, m_colFromL0Flag                 ( 1 )
     77#if SETTING_NO_OUT_PIC_PRIOR
     78, m_noOutputPriorPicsFlag         ( false )
     79, m_noRaslOutputFlag              ( false )
     80, m_handleCraAsBlaFlag            ( false )
     81#endif
    7782, m_colRefIdx                     ( 0 )
    7883, m_uiTLayer                      ( 0 )
     
    111116, m_bCrossLayerBLAFlag            ( false )
    112117#endif
    113 #if NO_OUTPUT_OF_PRIOR_PICS
    114 , m_noOutputOfPriorPicsFlag       ( false )
    115 , m_noRaslOutputFlag              ( false )
    116 , m_handleCraAsBlaFlag            ( false )
    117 #endif
    118118#if POC_RESET_IDC_SIGNALLING
    119119, m_pocResetIdc                   ( 0 )
     
    596596    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    597597#if SVC_EXTENSION    // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0
    598     // If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.
    599     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     598    // - If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.
     599    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    600600    if (getRapPicFlag() && getLayerId()==0)
    601601#else
    602     // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    603     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     602    // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     603    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    604604    if (getRapPicFlag())
    605605#endif
     
    10511051      pocCRA = pocCurr;
    10521052    }
     1053#if EFFICIENT_FIELD_IRAP
     1054    bRefreshPending = true;
     1055#endif
    10531056  }
    10541057  else // CRA or No DR
    10551058  {
     1059#if EFFICIENT_FIELD_IRAP
     1060    if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     1061    {
     1062      if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending
     1063      {
     1064        TComList<TComPic*>::iterator        iterPic       = rcListPic.begin();
     1065        while (iterPic != rcListPic.end())
     1066        {
     1067          rpcPic = *(iterPic);
     1068          if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR)
     1069          {
     1070            rpcPic->getSlice(0)->setReferenced(false);
     1071          }
     1072          iterPic++;
     1073        }
     1074        bRefreshPending = false;
     1075      }
     1076    }
     1077    else
     1078    {
     1079#endif
    10561080    if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending
    10571081    {
     
    10681092      bRefreshPending = false;
    10691093    }
     1094#if EFFICIENT_FIELD_IRAP
     1095    }
     1096#endif
    10701097    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    10711098    {
     
    13231350    // in decoding order shall precede the IRAP picture in output order.
    13241351    // (Note that any picture following in output order would be present in the DPB)
     1352#if !SETTING_NO_OUT_PIC_PRIOR
    13251353    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1354#else
     1355    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
     1356#endif
    13261357    {
    13271358      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     
    15021533/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    15031534*/
     1535#if ALLOW_RECOVERY_POINT_AS_RAP
     1536Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1537#else
    15041538Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    1505 {
     1539#endif
     1540{
     1541#if ALLOW_RECOVERY_POINT_AS_RAP
     1542  Int atLeastOneUnabledByRecoveryPoint = 0;
     1543  Int atLeastOneFlushedByPreviousIDR = 0;
     1544#endif
    15061545  TComPic* rpcPic;
    15071546  Int i, isAvailable;
     
    15241563        if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced())
    15251564        {
     1565#if ALLOW_RECOVERY_POINT_AS_RAP
     1566          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1567          {
     1568            isAvailable = 0;
     1569          }
     1570          else
     1571          {
    15261572          isAvailable = 1;
     1573        }
     1574#else
     1575          isAvailable = 1;
     1576#endif
    15271577        }
    15281578      }
     
    15341584        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    15351585        {
     1586#if ALLOW_RECOVERY_POINT_AS_RAP
     1587          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1588          {
     1589            isAvailable = 0;
     1590          }
     1591          else
     1592          {
    15361593          isAvailable = 1;
     1594        }
     1595#else
     1596          isAvailable = 1;
     1597#endif
    15371598        }
    15381599      }
     
    15571618        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    15581619        {
     1620#if ALLOW_RECOVERY_POINT_AS_RAP
     1621          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1622          {
     1623            isAvailable = 0;
     1624          }
     1625          else
     1626          {
    15591627          isAvailable = 1;
    15601628          rpcPic->setIsLongTerm(1);
    15611629          break;
     1630        }
     1631#else
     1632          isAvailable = 1;
     1633          rpcPic->setIsLongTerm(1);
     1634          break;
     1635#endif
    15621636        }
    15631637      }
     
    15871661        }
    15881662      }
     1663#if ALLOW_RECOVERY_POINT_AS_RAP
     1664      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1665      {
     1666        atLeastOneUnabledByRecoveryPoint = 1;
     1667      }
     1668      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1669      {
     1670        atLeastOneFlushedByPreviousIDR = 1;
     1671      }
     1672#endif
    15891673    }
    15901674  } 
     
    16021686      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced())
    16031687      {
     1688#if ALLOW_RECOVERY_POINT_AS_RAP
     1689        if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1690        {
     1691          isAvailable = 0;
     1692        }
     1693        else
     1694        {
    16041695        isAvailable = 1;
     1696      }
     1697#else
     1698        isAvailable = 1;
     1699#endif
    16051700      }
    16061701    }
     
    16291724        }
    16301725      }
    1631     }
     1726#if ALLOW_RECOVERY_POINT_AS_RAP
     1727      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1728      {
     1729        atLeastOneUnabledByRecoveryPoint = 1;
     1730      }
     1731      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1732      {
     1733        atLeastOneFlushedByPreviousIDR = 1;
     1734      }
     1735#endif
     1736    }
     1737    }
     1738#if ALLOW_RECOVERY_POINT_AS_RAP
     1739  if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR)
     1740  {
     1741    return -1;
    16321742  }   
     1743#endif
    16331744  if(atLeastOneLost)
    16341745  {
     
    16471758/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    16481759*/
     1760#if ALLOW_RECOVERY_POINT_AS_RAP
     1761Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1762#else
    16491763Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1764#endif
    16501765{
    16511766  TComPic* rpcPic;
     
    16731788        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
    16741789        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
     1790#if ALLOW_RECOVERY_POINT_AS_RAP
     1791        pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
     1792#endif
    16751793        if(pcRPS->getDeltaPOC(k) < 0)
    16761794        {
     
    16851803    }
    16861804  }
     1805#if EFFICIENT_FIELD_IRAP
     1806  Bool useNewRPS = false;
     1807  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
     1808  if(m_pcPic->isField())
     1809  {
     1810    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1811    while ( iterPic != rcListPic.end())
     1812    {
     1813      rpcPic = *(iterPic++);
     1814      if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
     1815      {
     1816        pcRPS->setDeltaPOC(k, 1);
     1817        pcRPS->setUsed(k, true);
     1818        nrOfPositivePictures++;
     1819        k ++;
     1820        useNewRPS = true;
     1821      }
     1822    }
     1823  }
     1824#endif
    16871825  pcRPS->setNumberOfNegativePictures(nrOfNegativePictures);
    16881826  pcRPS->setNumberOfPositivePictures(nrOfPositivePictures);
     
    16911829  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
    16921830  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
    1693   if (!pReferencePictureSet->getInterRPSPrediction())
     1831  if (!pReferencePictureSet->getInterRPSPrediction()
     1832#if EFFICIENT_FIELD_IRAP
     1833    || useNewRPS
     1834#endif
     1835    )
    16941836  {
    16951837    pcRPS->setInterRPSPrediction(false);
Note: See TracChangeset for help on using the changeset viewer.