Changeset 652 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 7 Apr 2014, 23:08:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp
r644 r652 75 75 , m_pcPic ( NULL ) 76 76 , m_colFromL0Flag ( 1 ) 77 #if SETTING_NO_OUT_PIC_PRIOR 78 , m_noOutputPriorPicsFlag ( false ) 79 , m_noRaslOutputFlag ( false ) 80 , m_handleCraAsBlaFlag ( false ) 81 #endif 77 82 , m_colRefIdx ( 0 ) 78 83 , m_uiTLayer ( 0 ) … … 111 116 , m_bCrossLayerBLAFlag ( false ) 112 117 #endif 113 #if NO_OUTPUT_OF_PRIOR_PICS114 , m_noOutputOfPriorPicsFlag ( false )115 , m_noRaslOutputFlag ( false )116 , m_handleCraAsBlaFlag ( false )117 #endif118 118 #if POC_RESET_IDC_SIGNALLING 119 119 , m_pocResetIdc ( 0 ) … … 596 596 // 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: 597 597 #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. 600 600 if (getRapPicFlag() && getLayerId()==0) 601 601 #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. 604 604 if (getRapPicFlag()) 605 605 #endif … … 1051 1051 pocCRA = pocCurr; 1052 1052 } 1053 #if EFFICIENT_FIELD_IRAP 1054 bRefreshPending = true; 1055 #endif 1053 1056 } 1054 1057 else // CRA or No DR 1055 1058 { 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 1056 1080 if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending 1057 1081 { … … 1068 1092 bRefreshPending = false; 1069 1093 } 1094 #if EFFICIENT_FIELD_IRAP 1095 } 1096 #endif 1070 1097 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 1071 1098 { … … 1323 1350 // in decoding order shall precede the IRAP picture in output order. 1324 1351 // (Note that any picture following in output order would be present in the DPB) 1352 #if !SETTING_NO_OUT_PIC_PRIOR 1325 1353 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1354 #else 1355 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag()) 1356 #endif 1326 1357 { 1327 1358 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || … … 1502 1533 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1503 1534 */ 1535 #if ALLOW_RECOVERY_POINT_AS_RAP 1536 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint) 1537 #else 1504 1538 Int 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 1506 1545 TComPic* rpcPic; 1507 1546 Int i, isAvailable; … … 1524 1563 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1525 1564 { 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 { 1526 1572 isAvailable = 1; 1573 } 1574 #else 1575 isAvailable = 1; 1576 #endif 1527 1577 } 1528 1578 } … … 1534 1584 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1535 1585 { 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 { 1536 1593 isAvailable = 1; 1594 } 1595 #else 1596 isAvailable = 1; 1597 #endif 1537 1598 } 1538 1599 } … … 1557 1618 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1558 1619 { 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 { 1559 1627 isAvailable = 1; 1560 1628 rpcPic->setIsLongTerm(1); 1561 1629 break; 1630 } 1631 #else 1632 isAvailable = 1; 1633 rpcPic->setIsLongTerm(1); 1634 break; 1635 #endif 1562 1636 } 1563 1637 } … … 1587 1661 } 1588 1662 } 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 1589 1673 } 1590 1674 } … … 1602 1686 if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1603 1687 { 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 { 1604 1695 isAvailable = 1; 1696 } 1697 #else 1698 isAvailable = 1; 1699 #endif 1605 1700 } 1606 1701 } … … 1629 1724 } 1630 1725 } 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; 1632 1742 } 1743 #endif 1633 1744 if(atLeastOneLost) 1634 1745 { … … 1647 1758 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1648 1759 */ 1760 #if ALLOW_RECOVERY_POINT_AS_RAP 1761 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint) 1762 #else 1649 1763 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1764 #endif 1650 1765 { 1651 1766 TComPic* rpcPic; … … 1673 1788 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1674 1789 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 1675 1793 if(pcRPS->getDeltaPOC(k) < 0) 1676 1794 { … … 1685 1803 } 1686 1804 } 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 1687 1825 pcRPS->setNumberOfNegativePictures(nrOfNegativePictures); 1688 1826 pcRPS->setNumberOfPositivePictures(nrOfPositivePictures); … … 1691 1829 // inter RPS prediction with. Here we just use the reference used by pReferencePictureSet. 1692 1830 // 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 ) 1694 1836 { 1695 1837 pcRPS->setInterRPSPrediction(false);
Note: See TracChangeset for help on using the changeset viewer.