Changeset 1367 in SHVCSoftware
- Timestamp:
- 22 Jul 2015, 04:38:38 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1365 r1367 61 61 , m_iAssociatedIRAP ( 0 ) 62 62 , m_iAssociatedIRAPType ( NAL_UNIT_INVALID ) 63 , m_p cRPS( 0 )64 , m_ LocalRPS ( )65 , m_ iBDidx ( 0 )63 , m_pRPS ( 0 ) 64 , m_localRPS ( ) 65 , m_rpsIdx ( 0 ) 66 66 , m_RefPicListModification ( ) 67 67 , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL ) … … 417 417 { 418 418 #endif 419 for(i=0; i < m_p cRPS->getNumberOfNegativePictures(); i++)420 { 421 if(m_p cRPS->getUsed(i))422 { 423 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_p cRPS->getDeltaPOC(i));419 for(i=0; i < m_pRPS->getNumberOfNegativePictures(); i++) 420 { 421 if(m_pRPS->getUsed(i)) 422 { 423 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pRPS->getDeltaPOC(i)); 424 424 pcRefPic->setIsLongTerm(0); 425 425 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 430 430 } 431 431 432 for(; i < m_p cRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)433 { 434 if(m_p cRPS->getUsed(i))435 { 436 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_p cRPS->getDeltaPOC(i));432 for(; i < m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures(); i++) 433 { 434 if(m_pRPS->getUsed(i)) 435 { 436 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pRPS->getDeltaPOC(i)); 437 437 pcRefPic->setIsLongTerm(0); 438 438 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 443 443 } 444 444 445 for(i = m_p cRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)446 { 447 if(m_p cRPS->getUsed(i))448 { 449 pcRefPic = xGetLongTermRefPic(rcListPic, m_p cRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));445 for(i = m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures()+m_pRPS->getNumberOfLongtermPictures()-1; i > m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures()-1 ; i--) 446 { 447 if(m_pRPS->getUsed(i)) 448 { 449 pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i)); 450 450 pcRefPic->setIsLongTerm(1); 451 451 pcRefPic->getPicYuvRec()->extendPicBorder(); … … 455 455 if(pcRefPic==NULL) 456 456 { 457 pcRefPic = xGetLongTermRefPic(rcListPic, m_p cRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));458 } 459 pcRefPic->setCheckLTMSBPresent(m_p cRPS->getCheckLTMSBPresent(i));457 pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i)); 458 } 459 pcRefPic->setCheckLTMSBPresent(m_pRPS->getCheckLTMSBPresent(i)); 460 460 } 461 461 #if SVC_EXTENSION … … 701 701 #endif 702 702 } 703 for(UInt i=0; i < m_p cRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)704 { 705 if(m_p cRPS->getUsed(i))703 for(UInt i=0; i < m_pRPS->getNumberOfNegativePictures()+ m_pRPS->getNumberOfPositivePictures() + m_pRPS->getNumberOfLongtermPictures(); i++) 704 { 705 if(m_pRPS->getUsed(i)) 706 706 { 707 707 numRpsCurrTempList++; … … 1022 1022 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1023 1023 #endif 1024 m_p cRPS = pSrc->m_pcRPS;1024 m_pRPS = pSrc->m_pRPS; 1025 1025 m_iLastIDR = pSrc->m_iLastIDR; 1026 1026 … … 1635 1635 Int nrOfNegativePictures = 0; 1636 1636 Int nrOfPositivePictures = 0; 1637 TComReferencePictureSet* p cRPS = this->getLocalRPS();1638 (*p cRPS)=TComReferencePictureSet();1637 TComReferencePictureSet* pLocalRPS = this->getLocalRPS(); 1638 (*pLocalRPS)=TComReferencePictureSet(); 1639 1639 1640 1640 Bool irapIsInRPS = false; // Used when bEfficientFieldIRAPEnabled==true … … 1670 1670 // and should be added to the explicit Reference Picture Set 1671 1671 #if SVC_POC 1672 p cRPS->setDeltaPOC(k, deltaPOC);1672 pLocalRPS->setDeltaPOC(k, deltaPOC); 1673 1673 #else 1674 p cRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));1675 #endif 1676 p cRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));1674 pLocalRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1675 #endif 1676 pLocalRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1677 1677 if (bEfficientFieldIRAPEnabled) 1678 1678 { 1679 1679 #if SVC_POC 1680 p cRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + deltaPOC < pocRandomAccess) );1680 pLocalRPS->setUsed(k, pLocalRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + deltaPOC < pocRandomAccess) ); 1681 1681 #else 1682 p cRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );1683 #endif 1684 } 1685 1686 if(p cRPS->getDeltaPOC(k) < 0)1682 pLocalRPS->setUsed(k, pLocalRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) ); 1683 #endif 1684 } 1685 1686 if(pLocalRPS->getDeltaPOC(k) < 0) 1687 1687 { 1688 1688 nrOfNegativePictures++; … … 1711 1711 if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1) 1712 1712 { 1713 p cRPS->setDeltaPOC(k, 1);1714 p cRPS->setUsed(k, true);1713 pLocalRPS->setDeltaPOC(k, 1); 1714 pLocalRPS->setUsed(k, true); 1715 1715 nrOfPositivePictures++; 1716 1716 k ++; … … 1719 1719 } 1720 1720 } 1721 p cRPS->setNumberOfNegativePictures(nrOfNegativePictures);1722 p cRPS->setNumberOfPositivePictures(nrOfPositivePictures);1723 p cRPS->setNumberOfPictures(nrOfNegativePictures+nrOfPositivePictures);1721 pLocalRPS->setNumberOfNegativePictures(nrOfNegativePictures); 1722 pLocalRPS->setNumberOfPositivePictures(nrOfPositivePictures); 1723 pLocalRPS->setNumberOfPictures(nrOfNegativePictures+nrOfPositivePictures); 1724 1724 // This is a simplistic inter rps example. A smarter encoder will look for a better reference RPS to do the 1725 1725 // inter RPS prediction with. Here we just use the reference used by pReferencePictureSet. … … 1731 1731 ) 1732 1732 { 1733 p cRPS->setInterRPSPrediction(false);1734 p cRPS->setNumRefIdc(0);1733 pLocalRPS->setInterRPSPrediction(false); 1734 pLocalRPS->setNumRefIdc(0); 1735 1735 } 1736 1736 else … … 1745 1745 Int deltaPOC = ((i != iRefPics)? pcRefRPS->getDeltaPOC(i) : 0); // check if the reference abs POC is >= 0 1746 1746 Int iRefIdc = 0; 1747 for (j=0; j < p cRPS->getNumberOfPictures(); j++) // loop through the pictures in the new RPS1748 { 1749 if ( (deltaPOC + deltaRPS) == p cRPS->getDeltaPOC(j))1750 { 1751 if (p cRPS->getUsed(j))1747 for (j=0; j < pLocalRPS->getNumberOfPictures(); j++) // loop through the pictures in the new RPS 1748 { 1749 if ( (deltaPOC + deltaRPS) == pLocalRPS->getDeltaPOC(j)) 1750 { 1751 if (pLocalRPS->getUsed(j)) 1752 1752 { 1753 1753 iRefIdc = 1; … … 1759 1759 } 1760 1760 } 1761 p cRPS->setRefIdc(i, iRefIdc);1761 pLocalRPS->setRefIdc(i, iRefIdc); 1762 1762 iNewIdc++; 1763 1763 } 1764 p cRPS->setInterRPSPrediction(true);1765 p cRPS->setNumRefIdc(iNewIdc);1766 p cRPS->setDeltaRPS(deltaRPS);1767 p cRPS->setDeltaRIdxMinus1(pReferencePictureSet->getDeltaRIdxMinus1() + this->getSPS()->getRPSList()->getNumberOfReferencePictureSets() - this->getRPSidx());1768 } 1769 1770 this->setRPS(p cRPS);1764 pLocalRPS->setInterRPSPrediction(true); 1765 pLocalRPS->setNumRefIdc(iNewIdc); 1766 pLocalRPS->setDeltaRPS(deltaRPS); 1767 pLocalRPS->setDeltaRIdxMinus1(pReferencePictureSet->getDeltaRIdxMinus1() + this->getSPS()->getRPSList()->getNumberOfReferencePictureSets() - this->getRPSidx()); 1768 } 1769 1770 this->setRPS(pLocalRPS); 1771 1771 this->setRPSidx(-1); 1772 1772 } … … 3846 3846 Int numPocBeforeCurr = 0; 3847 3847 3848 for( UInt i = 0; i < m_p cRPS->getNumberOfNegativePictures(); i++ )3849 { 3850 if( m_p cRPS->getUsed(i) )3848 for( UInt i = 0; i < m_pRPS->getNumberOfNegativePictures(); i++ ) 3849 { 3850 if( m_pRPS->getUsed(i) ) 3851 3851 { 3852 3852 numPocBeforeCurr++; -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1366 r1367 2025 2025 Int m_iAssociatedIRAP; 2026 2026 NalUnitType m_iAssociatedIRAPType; 2027 const TComReferencePictureSet* m_pcRPS;2028 TComReferencePictureSet m_ LocalRPS;2029 Int m_ iBDidx;2027 const TComReferencePictureSet* m_pRPS; //< pointer to RPS, either in the SPS or the local RPS in the same slice header 2028 TComReferencePictureSet m_localRPS; //< RPS when present in slice header 2029 Int m_rpsIdx; //< index of used RPS in the SPS or -1 for local RPS in the slice header 2030 2030 TComRefPicListModification m_RefPicListModification; 2031 2031 NalUnitType m_eNalUnitType; ///< Nal unit type for the slice … … 2170 2170 Void setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; } 2171 2171 Bool getSaoEnabledFlag(ChannelType chType) const { return m_saoEnabledFlag[chType]; } 2172 Void setRPS( const TComReferencePictureSet *pcRPS ) { m_p cRPS = pcRPS;}2173 const TComReferencePictureSet* getRPS() { return m_pcRPS;}2174 TComReferencePictureSet* getLocalRPS() { return &m_ LocalRPS; }2175 2176 Void setRPSidx( Int iBDidx ) { m_iBDidx = iBDidx; }2177 Int getRPSidx() const { return m_ iBDidx; }2172 Void setRPS( const TComReferencePictureSet *pcRPS ) { m_pRPS = pcRPS; } 2173 const TComReferencePictureSet* getRPS() { return m_pRPS; } 2174 TComReferencePictureSet* getLocalRPS() { return &m_localRPS; } 2175 2176 Void setRPSidx( Int rpsIdx ) { m_rpsIdx = rpsIdx; } 2177 Int getRPSidx() const { return m_rpsIdx; } 2178 2178 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 2179 2179 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1366 r1367 1926 1926 #endif 1927 1927 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 1928 // pcSlice->getRPS()->setNumberOfLongtermPictures(0);1929 1928 if (!m_pcCfg->getEfficientFieldIRAPEnabled()) 1930 1929 {
Note: See TracChangeset for help on using the changeset viewer.