Changeset 652 in SHVCSoftware for branches/SHM-6-dev
- Timestamp:
- 7 Apr 2014, 23:08:52 (11 years ago)
- Location:
- branches/SHM-6-dev/source
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/App/TAppDecoder/TAppDecTop.cpp
r644 r652 257 257 Bool outputPicturesFlag = true; 258 258 #if NO_OUTPUT_OF_PRIOR_PICS 259 if( m_acTDecTop[nalu.m_layerId].getNoOutput OfPriorPicsFlags() )259 if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() ) 260 260 { 261 261 outputPicturesFlag = false; … … 449 449 loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS); 450 450 } 451 #if !FIX_WRITING_OUTPUT 452 #if SETTING_NO_OUT_PIC_PRIOR 453 if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag()) 454 { 455 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 456 } 457 #endif 458 #endif 451 459 452 460 if( pcListPic ) … … 460 468 openedReconFile = true; 461 469 } 470 #if FIX_WRITING_OUTPUT 471 // write reconstruction to file 472 if( bNewPicture ) 473 { 474 xWriteOutput( pcListPic, nalu.m_temporalId ); 475 } 476 #if SETTING_NO_OUT_PIC_PRIOR 477 if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() ) 478 { 479 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 480 m_cTDecTop.setNoOutputPriorPicsFlag (false); 481 } 482 #endif 483 #endif 462 484 if ( bNewPicture && 463 485 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 471 493 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 472 494 { 495 #if FIX_OUTPUT_EOS 496 xWriteOutput( pcListPic, nalu.m_temporalId ); 497 #else 473 498 xFlushOutput( pcListPic ); 474 } 475 // write reconstruction to file 499 #endif 500 } 501 // write reconstruction to file -- for additional bumping as defined in C.5.2.3 502 #if FIX_WRITING_OUTPUT 503 if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31) 504 #else 476 505 if(bNewPicture) 506 #endif 477 507 { 478 508 xWriteOutput( pcListPic, nalu.m_temporalId ); … … 586 616 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 587 617 Int numPicsNotYetDisplayed = 0; 618 Int dpbFullness = 0; 619 #if SVC_EXTENSION 620 TComSPS* activeSPS = m_acTDecTop[layerId].getActiveSPS(); 621 #else 622 TComSPS* activeSPS = m_cTDecTop.getActiveSPS(); 623 #endif 624 UInt numReorderPicsHighestTid; 625 UInt maxDecPicBufferingHighestTid; 626 UInt maxNrSublayers = activeSPS->getMaxTLayers(); 627 628 if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers) 629 { 630 numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1); 631 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(maxNrSublayers-1); 632 } 633 else 634 { 635 numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer); 636 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer); 637 } 588 638 589 639 while (iterPic != pcListPic->end()) … … 597 647 { 598 648 numPicsNotYetDisplayed++; 649 dpbFullness++; 650 } 651 else if(pcPic->getSlice( 0 )->isReferenced()) 652 { 653 dpbFullness++; 599 654 } 600 655 iterPic++; … … 619 674 620 675 #if SVC_EXTENSION 621 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 622 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0))) 623 #else 624 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 625 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 676 if( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 677 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 678 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 679 (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0) ) 680 #else 681 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 682 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 683 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 684 (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0)) 626 685 #endif 627 686 { … … 720 779 721 780 #if SVC_EXTENSION 722 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId])) 723 #else 724 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 781 if( pcPic->getOutputMark() && pcPic->getPOC() > m_aiPOCLastDisplay[layerId] && 782 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) ) 783 #else 784 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay && 785 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) 725 786 #endif 726 787 { 727 788 // write to file 728 789 numPicsNotYetDisplayed--; 729 #if SVC_EXTENSION 730 if ( m_pchReconFile[layerId] ) 790 if(pcPic->getSlice(0)->isReferenced() == false) 791 { 792 dpbFullness--; 793 } 794 #if SVC_EXTENSION 795 if( m_pchReconFile[layerId] ) 731 796 { 732 797 const Window &conf = pcPic->getConformanceWindow(); -
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r649 r652 710 710 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 711 711 #endif 712 #if ALLOW_RECOVERY_POINT_AS_RAP 713 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") 714 #else 712 715 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 716 #endif 713 717 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 714 718 // motion options … … 905 909 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") 906 910 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") 911 ("SEIToneMapExposureIndexIdc", m_exposureIndexIdc, 0, "Indicates the exposure index setting of the camera") 912 ("SEIToneMapExposureIndexValue", m_exposureIndexValue, 400, "Specifies the exposure index setting of the cameran of Extended_ISO") 907 913 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") 908 914 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") … … 1587 1593 xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); 1588 1594 #endif 1595 #if ALLOW_RECOVERY_POINT_AS_RAP 1596 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" ); 1597 if(m_iDecodingRefreshType == 3) 1598 { 1599 xConfirmPara( !m_recoveryPointSEIEnabled, "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" ); 1600 } 1601 #else 1589 1602 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); 1603 #endif 1590 1604 #if !SVC_EXTENSION 1591 1605 xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); … … 2160 2174 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); 2161 2175 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); 2176 xConfirmPara( m_exposureIndexValue == 0, "SEIToneMapExposureIndexValue shall not be equal to 0"); 2162 2177 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); 2163 2178 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); -
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h
r644 r652 255 255 Int m_cameraIsoSpeedIdc; 256 256 Int m_cameraIsoSpeedValue; 257 Int m_exposureIndexIdc; 258 Int m_exposureIndexValue; 257 259 Int m_exposureCompensationValueSignFlag; 258 260 Int m_exposureCompensationValueNumerator; -
branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp
r649 r652 767 767 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 768 768 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 769 m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 770 m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); 769 771 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 770 772 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); -
branches/SHM-6-dev/source/Lib/TLibCommon/CommonDef.h
r644 r652 60 60 #define NV_VERSION "5.1 (HM-13.0)" ///< Current software version 61 61 #else 62 #define NV_VERSION "1 3.0" ///< Current software version62 #define NV_VERSION "14.0" ///< Current software version 63 63 #endif 64 64 -
branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h
r644 r652 142 142 SEIActiveParameterSets() 143 143 : activeVPSId (0) 144 , m_ fullRandomAccessFlag (false)145 , m_noParam SetUpdateFlag (false)144 , m_selfContainedCvsFlag (false) 145 , m_noParameterSetUpdateFlag (false) 146 146 , numSpsIdsMinus1 (0) 147 147 {} … … 149 149 150 150 Int activeVPSId; 151 Bool m_ fullRandomAccessFlag;152 Bool m_noParam SetUpdateFlag;151 Bool m_selfContainedCvsFlag; 152 Bool m_noParameterSetUpdateFlag; 153 153 Int numSpsIdsMinus1; 154 std::vector<Int> activeSeqParam SetId;154 std::vector<Int> activeSeqParameterSetId; 155 155 }; 156 156 … … 393 393 Int m_cameraIsoSpeedIdc; 394 394 Int m_cameraIsoSpeedValue; 395 Int m_exposureIndexIdc; 396 Int m_exposureIndexValue; 395 397 Int m_exposureCompensationValueSignFlag; 396 398 Int m_exposureCompensationValueNumerator; -
branches/SHM-6-dev/source/Lib/TLibCommon/TComDataCU.cpp
r595 r652 1690 1690 } 1691 1691 1692 1693 #if FAST_INTRA_SHVC1694 /** generate limited set of remaining modes1695 *\param uiAbsPartIdx1696 *\param uiIntraDirPred pointer to the array for MPM storage1697 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)1698 */1699 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )1700 {1701 // check BL mode1702 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0;1703 // the right reference layerIdc should be specified, currently it is set to m_layerId-11704 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );1705 1706 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )1707 {1708 return( NUM_INTRA_MODE-1 );1709 }1710 1711 // compute set of enabled modes g_reducedSetIntraModes[...]1712 Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};1713 Int nbModes;1714 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st1715 {1716 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];1717 authorizedMode[ uiIntraDirPred[nbModes] ] = 0;1718 }1719 1720 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );1721 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode1722 {1723 g_reducedSetIntraModes[nbModes++] = iColBaseDir;1724 authorizedMode[ iColBaseDir ] = 0;1725 }1726 1727 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];1728 if ( iRefMode > 1 ) //add neighboring modes of refMode1729 {1730 UInt Left = iRefMode;1731 UInt Right = iRefMode;1732 while ( nbModes < NB_REMAIN_MODES+3 )1733 {1734 Left = ((Left + 29) % 32) + 2;1735 Right = ((Right - 1 ) % 32) + 2;1736 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left;1737 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right;1738 }1739 }1740 else //add pre-defined modes1741 {1742 Int idx = 0;1743 while ( nbModes < NB_REMAIN_MODES+3 )1744 {1745 UInt mode = g_predefSetIntraModes[idx++];1746 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode;1747 }1748 }1749 1750 fullSetOfModes = 0;1751 return ( nbModes );1752 }1753 #endif1754 1755 1756 1692 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) 1757 1693 { … … 1809 1745 return log2MinTUSizeInCU; 1810 1746 } 1811 1812 #if REF_IDX_ME_ZEROMV1813 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)1814 {1815 Bool checkZeroMVILR = true;1816 1817 if(uhInterDir&0x1) //list01818 {1819 Int refIdxL0 = cMvFieldL0.getRefIdx();1820 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId))1821 {1822 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);1823 }1824 }1825 if(uhInterDir&0x2) //list11826 {1827 Int refIdxL1 = cMvFieldL1.getRefIdx();1828 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId))1829 {1830 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);1831 }1832 }1833 1834 return checkZeroMVILR;1835 }1836 1837 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)1838 {1839 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;1840 assert(eRefPicList == REF_PIC_LIST_1);1841 1842 Bool checkZeroMVILR = true;1843 1844 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId))1845 {1846 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();1847 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx];1848 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);1849 }1850 1851 return checkZeroMVILR;1852 }1853 #endif1854 1855 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI1856 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)1857 {1858 Bool checkILR = false;1859 1860 if(uhInterDir&0x1) //list01861 {1862 Int refIdxL0 = cMvFieldL0.getRefIdx();1863 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId);1864 }1865 if(uhInterDir&0x2) //list11866 {1867 Int refIdxL1 = cMvFieldL1.getRefIdx();1868 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId);1869 }1870 1871 return checkILR;1872 }1873 #endif1874 1747 1875 1748 UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx ) … … 2168 2041 } 2169 2042 2170 UChar TComDataCU::getNumPart Inter()2043 UChar TComDataCU::getNumPartitions() 2171 2044 { 2172 2045 UChar iNumPart = 0; … … 3680 3553 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 3681 3554 } 3555 3556 #if FAST_INTRA_SHVC 3557 /** generate limited set of remaining modes 3558 *\param uiAbsPartIdx 3559 *\param uiIntraDirPred pointer to the array for MPM storage 3560 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs) 3561 */ 3562 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ) 3563 { 3564 // check BL mode 3565 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0; 3566 // the right reference layerIdc should be specified, currently it is set to m_layerId-1 3567 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 ); 3568 3569 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) 3570 { 3571 return( NUM_INTRA_MODE-1 ); 3572 } 3573 3574 // compute set of enabled modes g_reducedSetIntraModes[...] 3575 Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; 3576 Int nbModes; 3577 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st 3578 { 3579 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes]; 3580 authorizedMode[ uiIntraDirPred[nbModes] ] = 0; 3581 } 3582 3583 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase ); 3584 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode 3585 { 3586 g_reducedSetIntraModes[nbModes++] = iColBaseDir; 3587 authorizedMode[ iColBaseDir ] = 0; 3588 } 3589 3590 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0]; 3591 if ( iRefMode > 1 ) //add neighboring modes of refMode 3592 { 3593 UInt Left = iRefMode; 3594 UInt Right = iRefMode; 3595 while ( nbModes < NB_REMAIN_MODES+3 ) 3596 { 3597 Left = ((Left + 29) % 32) + 2; 3598 Right = ((Right - 1 ) % 32) + 2; 3599 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left; 3600 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right; 3601 } 3602 } 3603 else //add pre-defined modes 3604 { 3605 Int idx = 0; 3606 while ( nbModes < NB_REMAIN_MODES+3 ) 3607 { 3608 UInt mode = g_predefSetIntraModes[idx++]; 3609 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode; 3610 } 3611 } 3612 3613 fullSetOfModes = 0; 3614 return ( nbModes ); 3615 } 3616 #endif 3617 3618 #if REF_IDX_ME_ZEROMV 3619 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3620 { 3621 Bool checkZeroMVILR = true; 3622 3623 if(uhInterDir&0x1) //list0 3624 { 3625 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3626 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 3627 { 3628 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3629 } 3630 } 3631 if(uhInterDir&0x2) //list1 3632 { 3633 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3634 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 3635 { 3636 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3637 } 3638 } 3639 3640 return checkZeroMVILR; 3641 } 3642 3643 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx) 3644 { 3645 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0; 3646 assert(eRefPicList == REF_PIC_LIST_1); 3647 3648 Bool checkZeroMVILR = true; 3649 3650 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId)) 3651 { 3652 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); 3653 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx]; 3654 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0); 3655 } 3656 3657 return checkZeroMVILR; 3658 } 3659 #endif 3660 3661 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3662 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3663 { 3664 Bool checkILR = false; 3665 3666 if(uhInterDir&0x1) //list0 3667 { 3668 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3669 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId); 3670 } 3671 if(uhInterDir&0x2) //list1 3672 { 3673 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3674 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId); 3675 } 3676 3677 return checkILR; 3678 } 3679 #endif 3680 3682 3681 #endif //SVC_EXTENSION 3683 3682 //! \} -
branches/SHM-6-dev/source/Lib/TLibCommon/TComDataCU.h
r595 r652 352 352 353 353 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 354 UChar getNumPart Inter();354 UChar getNumPartitions (); 355 355 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); 356 356 -
branches/SHM-6-dev/source/Lib/TLibCommon/TComMotionInfo.h
r595 r652 141 141 Void setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 142 142 143 #if AVC_SYNTAX144 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; }145 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; }146 #endif147 148 143 Void setNumPartition( Int iNumPart ) 149 144 { … … 159 154 160 155 Void compress(Char* pePredMode, Int scale); 156 157 #if AVC_SYNTAX 158 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; } 159 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; } 160 #endif 161 161 162 162 #if REF_IDX_MFM -
branches/SHM-6-dev/source/Lib/TLibCommon/TComPic.h
r595 r652 115 115 UInt getTLayer() { return m_uiTLayer; } 116 116 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 117 117 118 Bool getUsedByCurr() { return m_bUsedByCurr; } 118 119 Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } -
branches/SHM-6-dev/source/Lib/TLibCommon/TComPrediction.cpp
r644 r652 447 447 } 448 448 449 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPart Inter(); iPartIdx++ )449 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 450 450 { 451 451 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); -
branches/SHM-6-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r644 r652 112 112 m_offsetClipTable[compIdx] = NULL; 113 113 } 114 #if !SAO_SGN_FUNC 114 115 m_signTable = NULL; 115 116 #endif 116 117 117 118 m_lineBufWidth = 0; … … 169 170 } 170 171 172 #if !SAO_SGN_FUNC 171 173 //look-up table for clipping 174 Int overallMaxSampleValue=0; 175 #endif 172 176 for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 173 177 { … … 179 183 Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]); 180 184 #endif 185 #if !SAO_SGN_FUNC 186 if (maxSampleValue>overallMaxSampleValue) overallMaxSampleValue=maxSampleValue; 187 #endif 181 188 182 189 m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0 … … 194 201 *(offsetClipPtr -k -1 ) = 0; 195 202 } 196 if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC 197 { 198 m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ]; 199 m_sign = &(m_signTable[maxSampleValue-1]); 200 201 m_sign[0] = 0; 202 for(Int k=1; k< maxSampleValue; k++) 203 { 204 m_sign[k] = 1; 205 m_sign[-k]= -1; 206 } 207 } 208 } 209 203 } 204 205 #if !SAO_SGN_FUNC 206 m_signTable = new Short[ 2*(overallMaxSampleValue-1) + 1 ]; 207 m_sign = &(m_signTable[overallMaxSampleValue-1]); 208 209 m_sign[0] = 0; 210 for(Int k=1; k< overallMaxSampleValue; k++) 211 { 212 m_sign[k] = 1; 213 m_sign[-k]= -1; 214 } 215 #endif 210 216 } 211 217 … … 226 232 } 227 233 } 234 #if !SAO_SGN_FUNC 228 235 if( m_signTable ) 229 236 { 230 237 delete[] m_signTable; m_signTable = NULL; 231 238 } 239 #endif 232 240 } 233 241 … … 406 414 for (y=0; y< height; y++) 407 415 { 416 #if SAO_SGN_FUNC 417 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 418 #else 408 419 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 420 #endif 409 421 for (x=startX; x< endX; x++) 410 422 { 423 #if SAO_SGN_FUNC 424 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 425 #else 411 426 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 427 #endif 412 428 edgeType = signRight + signLeft; 413 429 signLeft = -signRight; … … 437 453 for (x=0; x< width; x++) 438 454 { 455 #if SAO_SGN_FUNC 456 signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]); 457 #else 439 458 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 459 #endif 440 460 } 441 461 … … 447 467 for (x=0; x< width; x++) 448 468 { 469 #if SAO_SGN_FUNC 470 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x]); 471 #else 449 472 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 473 #endif 450 474 edgeType = signDown + signUpLine[x]; 451 475 signUpLine[x]= -signDown; … … 474 498 for (x=startX; x< endX+1; x++) 475 499 { 500 #if SAO_SGN_FUNC 501 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]); 502 #else 476 503 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]]; 504 #endif 477 505 } 478 506 … … 483 511 for(x= firstLineStartX; x< firstLineEndX; x++) 484 512 { 513 #if SAO_SGN_FUNC 514 edgeType = sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1]; 515 #else 485 516 edgeType = m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1]; 517 #endif 486 518 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 487 519 } … … 497 529 for (x=startX; x<endX; x++) 498 530 { 531 #if SAO_SGN_FUNC 532 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]); 533 #else 499 534 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ; 535 #endif 500 536 edgeType = signDown + signUpLine[x]; 501 537 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; … … 503 539 signDownLine[x+1] = -signDown; 504 540 } 541 #if SAO_SGN_FUNC 542 signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]); 543 #else 505 544 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 545 #endif 506 546 507 547 signTmpLine = signUpLine; … … 519 559 for(x= lastLineStartX; x< lastLineEndX; x++) 520 560 { 561 #if SAO_SGN_FUNC 562 edgeType = sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x]; 563 #else 521 564 edgeType = m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x]; 565 #endif 522 566 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 523 567 … … 537 581 for (x=startX-1; x< endX; x++) 538 582 { 583 #if SAO_SGN_FUNC 584 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]); 585 #else 539 586 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 587 #endif 540 588 } 541 589 … … 547 595 for(x= firstLineStartX; x< firstLineEndX; x++) 548 596 { 597 #if SAO_SGN_FUNC 598 edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1]; 599 #else 549 600 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1]; 601 #endif 550 602 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 551 603 } … … 560 612 for(x= startX; x< endX; x++) 561 613 { 614 #if SAO_SGN_FUNC 615 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]); 616 #else 562 617 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 618 #endif 563 619 edgeType = signDown + signUpLine[x]; 564 620 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 565 621 signUpLine[x-1] = -signDown; 566 622 } 623 #if SAO_SGN_FUNC 624 signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]); 625 #else 567 626 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 627 #endif 568 628 srcLine += srcStride; 569 629 resLine += resStride; … … 576 636 for(x= lastLineStartX; x< lastLineEndX; x++) 577 637 { 638 #if SAO_SGN_FUNC 639 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x]; 640 #else 578 641 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x]; 642 #endif 579 643 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 580 644 -
branches/SHM-6-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r644 r652 56 56 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 57 57 #endif 58 #if SAO_SGN_FUNC 59 template <typename T> int sgn(T val) 60 { 61 return (T(0) < val) - (val < T(0)); 62 } 63 #endif 58 64 59 65 class TComSampleAdaptiveOffset … … 88 94 UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 89 95 Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation 96 #if !SAO_SGN_FUNC 90 97 Short* m_sign; //sign table for fast operation 98 #endif 91 99 TComPicYuv* m_tempPicYuv; //temporary buffer 92 100 Int m_picWidth; … … 105 113 Bool m_picSAOEnabled[NUM_SAO_COMPONENTS]; 106 114 Int* m_offsetClipTable[NUM_SAO_COMPONENTS]; 115 #if !SAO_SGN_FUNC 107 116 Short* m_signTable; 117 #endif 108 118 #if SVC_EXTENSION 109 119 UInt m_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; -
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); -
branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h
r644 r652 231 231 { 232 232 ProfileTierLevel m_generalPTL; 233 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 ( = 6)233 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) 234 234 Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; 235 235 Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; … … 1963 1963 UInt m_colFromL0Flag; // collocated picture from List0 flag 1964 1964 1965 #if SETTING_NO_OUT_PIC_PRIOR 1966 Bool m_noOutputPriorPicsFlag; 1967 Bool m_noRaslOutputFlag; 1968 Bool m_handleCraAsBlaFlag; 1969 #endif 1970 1965 1971 UInt m_colRefIdx; 1966 1972 UInt m_maxNumMergeCand; … … 2029 2035 #if O0149_CROSS_LAYER_BLA_FLAG 2030 2036 Bool m_bCrossLayerBLAFlag; 2031 #endif2032 #if NO_OUTPUT_OF_PRIOR_PICS2033 Bool m_noOutputOfPriorPicsFlag;2034 Bool m_noRaslOutputFlag;2035 Bool m_handleCraAsBlaFlag;2036 2037 #endif 2037 2038 #if POC_RESET_IDC_SIGNALLING … … 2130 2131 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 2131 2132 Bool getRapPicFlag (); 2132 #if NO_OUTPUT_OF_PRIOR_PICS2133 Bool getBlaPicFlag ();2134 Bool getCraPicFlag ();2135 #endif2136 2133 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2137 2134 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } … … 2203 2200 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 2204 2201 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); 2205 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2206 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2202 #if ALLOW_RECOVERY_POINT_AS_RAP 2203 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2204 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2205 #else 2206 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2207 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2208 #endif 2207 2209 2208 2210 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } 2209 2211 UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } 2212 2213 #if SETTING_NO_OUT_PIC_PRIOR 2214 Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } 2215 Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } 2216 2217 Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } 2218 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } 2219 2220 Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } 2221 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } 2222 #endif 2210 2223 2211 2224 Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } … … 2360 2373 2361 2374 Void setILRPic(TComPic **pcIlpPic); 2362 #if NO_OUTPUT_OF_PRIOR_PICS2363 Void setNoOutputOfPriorPicsFlag(const Bool x) { m_noOutputOfPriorPicsFlag = x; }2364 Bool getNoOutputOfPriorPicsFlag() { return m_noOutputOfPriorPicsFlag; }2365 2366 Void setNoRaslOutputFlag ( const Bool val ) { m_noRaslOutputFlag = val; }2367 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; }2368 2369 Void setHandleCraAsBlaFlag ( const Bool val ) { m_handleCraAsBlaFlag = val; }2370 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; }2371 2372 #endif2373 2375 #if POC_RESET_IDC_SIGNALLING 2374 2376 Int getPocResetIdc () { return m_pocResetIdc; } … … 2388 2390 #endif 2389 2391 2392 #if NO_OUTPUT_OF_PRIOR_PICS 2393 Bool getBlaPicFlag (); 2394 Bool getCraPicFlag (); 2395 #endif 2396 2390 2397 #endif //SVC_EXTENSION 2391 2398 protected: -
branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h
r644 r652 264 264 //! \ingroup TLibCommon 265 265 //! \{ 266 #define HARMONIZE_GOP_FIRST_FIELD_COUPLE 1 267 #define FIX_FIELD_DEPTH 1 268 #define EFFICIENT_FIELD_IRAP 1 269 #define ALLOW_RECOVERY_POINT_AS_RAP 1 266 270 #define BUGFIX_INTRAPERIOD 1 267 271 #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1 268 272 273 #define SAO_SGN_FUNC 1 274 269 275 #define FIX1172 1 ///< fix ticket #1172 276 277 #define SETTING_PIC_OUTPUT_MARK 1 278 #define SETTING_NO_OUT_PIC_PRIOR 1 279 #define FIX_EMPTY_PAYLOAD_NAL 1 280 #define FIX_WRITING_OUTPUT 1 281 #define FIX_OUTPUT_EOS 1 282 283 #define FIX_POC_CRA_NORASL_OUTPUT 1 270 284 271 285 #define MAX_NUM_PICS_IN_SOP 1024 -
branches/SHM-6-dev/source/Lib/TLibDecoder/AnnexBread.h
r595 r652 65 65 , m_Input(istream) 66 66 { 67 istream.exceptions(std::istream::eofbit );67 istream.exceptions(std::istream::eofbit | std::istream::badbit); 68 68 } 69 69 -
branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp
r644 r652 518 518 { 519 519 UInt val; 520 READ_CODE(4, val, "active_v ps_id");sei.activeVPSId = val;521 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false;522 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;520 READ_CODE(4, val, "active_video_parameter_set_id"); sei.activeVPSId = val; 521 READ_FLAG( val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = val ? true : false; 522 READ_FLAG( val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = val ? true : false; 523 523 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 524 524 525 sei.activeSeqParam SetId.resize(sei.numSpsIdsMinus1 + 1);525 sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1); 526 526 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++) 527 527 { 528 READ_UVLC(val, "active_seq_param_set_id"); sei.activeSeqParamSetId[i] = val; 529 } 530 531 UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned(); 532 533 while(uibits--) 534 { 535 READ_FLAG(val, "alignment_bit"); 536 } 528 READ_UVLC(val, "active_seq_parameter_set_id"); sei.activeSeqParameterSetId[i] = val; 529 } 530 531 xParseByteAlign(); 537 532 } 538 533 … … 812 807 case 4: 813 808 { 814 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeed Value= val;815 if( sei.m_cameraIsoSpeed Value== 255) //Extended_ISO809 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeedIdc = val; 810 if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO 816 811 { 817 812 READ_CODE( 32, val, "camera_iso_speed_value" ); sei.m_cameraIsoSpeedValue = val; 813 } 814 READ_CODE( 8, val, "exposure_index_idc" ); sei.m_exposureIndexIdc = val; 815 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 816 { 817 READ_CODE( 32, val, "exposure_index_value" ); sei.m_exposureIndexValue = val; 818 818 } 819 819 READ_FLAG( val, "exposure_compensation_value_sign_flag" ); sei.m_exposureCompensationValueSignFlag = val; -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r649 r652 681 681 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 682 682 { 683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1 ");683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]"); 684 684 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 685 READ_UVLC ( uiCode, "sps_num_reorder_pics " );685 READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" ); 686 686 pcSPS->setNumReorderPics(uiCode, i); 687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1 ");687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 688 688 pcSPS->setMaxLatencyIncrease( uiCode, i ); 689 689 … … 887 887 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 888 888 #endif 889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6);889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode+1 <= MAX_TLAYER); 890 890 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 891 891 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); … … 2102 2102 if( rpcSlice->getRapPicFlag()) 2103 2103 { 2104 #if !NO_OUTPUT_OF_PRIOR_PICS 2105 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 2106 #else 2107 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false ); 2104 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored -- updated already 2105 #if SETTING_NO_OUT_PIC_PRIOR 2106 rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false); 2107 #else 2108 rpcSlice->setNoOutputPicPrior( false ); 2108 2109 #endif 2109 2110 } … … 2305 2306 else 2306 2307 { 2307 uiCode = 0; 2308 uiCode = 0; 2308 2309 } 2309 2310 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCu.cpp
r595 r652 715 715 { 716 716 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); 717 UInt uiNumPart = pcCU->getNumPart Inter();717 UInt uiNumPart = pcCU->getNumPartitions(); 718 718 UInt uiNumQParts = pcCU->getTotalNumPart() >> 2; 719 719 -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecGop.cpp
r595 r652 248 248 } 249 249 250 #if SETTING_PIC_OUTPUT_MARK 251 rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false); 252 #else 250 253 rpcPic->setOutputMark(true); 254 #endif 251 255 rpcPic->setReconMark(true); 252 256 } -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp
r644 r652 79 79 m_prevSliceSkipped = false; 80 80 m_skippedPOC = 0; 81 #if NO_CLRAS_OUTPUT_FLAG 82 m_noClrasOutputFlag = false; 81 #if SETTING_NO_OUT_PIC_PRIOR 82 m_bFirstSliceInBitstream = true; 83 m_lastPOCNoOutputPriorPics = -1; 84 m_craNoRaslOutputFlag = false; 85 m_isNoOutputPriorPics = false; 86 #endif 87 #if NO_CLRAS_OUTPUT_FLAG 83 88 m_layerInitializedFlag = false; 84 m_firstPicInLayerDecodedFlag = false; 85 m_noOutputOfPriorPicsFlags = false; 89 m_firstPicInLayerDecodedFlag = false; 86 90 m_bRefreshPending = false; 87 91 #endif … … 503 507 504 508 // Execute Deblock + Cleanup 505 506 509 m_cGopDecoder.filterPicture(pcPic); 507 510 … … 517 520 return; 518 521 } 522 523 #if SETTING_NO_OUT_PIC_PRIOR 524 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic) 525 { 526 if (!rpcListPic || !m_isNoOutputPriorPics) return; 527 528 TComList<TComPic*>::iterator iterPic = rpcListPic->begin(); 529 530 while (iterPic != rpcListPic->end()) 531 { 532 TComPic*& pcPicTmp = *(iterPic++); 533 if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC()) 534 { 535 pcPicTmp->setOutputMark(false); 536 } 537 } 538 } 539 #endif 519 540 520 541 #if EARLY_REF_PIC_MARKING … … 843 864 TComPic*& pcPic = m_pcPic; 844 865 #if SVC_EXTENSION 845 #if !NO_OUTPUT_OF_PRIOR_PICS846 #if NO_CLRAS_OUTPUT_FLAG847 Bool bFirstSliceInSeq;848 #endif849 #endif850 866 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); 851 867 #if OUTPUT_LAYER_SET_INDEX … … 900 916 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 901 917 902 #if NO_OUTPUT_OF_PRIOR_PICS 903 // Infer the value of NoOutputOfPriorPicsFlag 904 if( m_apcSlicePilot->getRapPicFlag() ) 905 { 906 if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag() || 907 (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) || 908 (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag())) 909 { 910 m_apcSlicePilot->setNoRaslOutputFlag( true ); 918 #if SETTING_NO_OUT_PIC_PRIOR 919 //For inference of NoOutputOfPriorPicsFlag 920 if (m_apcSlicePilot->getRapPicFlag()) 921 { 922 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 923 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 924 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) 925 { 926 m_apcSlicePilot->setNoRaslOutputFlag(true); 927 } 928 //the inference for NoOutputPriorPicsFlag 929 if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag()) 930 { 931 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 932 { 933 m_apcSlicePilot->setNoOutputPriorPicsFlag(true); 934 } 911 935 } 912 936 else 913 937 { 914 m_apcSlicePilot->setNoRaslOutputFlag( false ); 915 } 938 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 939 } 940 941 if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 942 { 943 m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag(); 944 } 945 } 946 if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag()) 947 { 948 m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC(); 949 m_isNoOutputPriorPics = true; 950 } 951 else 952 { 953 m_isNoOutputPriorPics = false; 954 } 955 956 //For inference of PicOutputFlag 957 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R) 958 { 959 if ( m_craNoRaslOutputFlag ) 960 { 961 m_apcSlicePilot->setPicOutputFlag(false); 962 } 963 } 964 #endif 965 966 #if FIX_POC_CRA_NORASL_OUTPUT 967 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 968 { 969 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 970 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 916 971 } 917 972 #endif … … 975 1030 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() ) 976 1031 { 977 this->setNoOutput OfPriorPicsFlags( true );1032 this->setNoOutputPriorPicsFlag( true ); 978 1033 } 979 1034 else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() ) 980 1035 { 981 this->setNoOutput OfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() );1036 this->setNoOutputPriorPicsFlag( m_apcSlicePilot->getNoOutputPriorPicsFlag() ); 982 1037 } 983 1038 else … … 985 1040 if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() ) 986 1041 { 987 this->setNoOutput OfPriorPicsFlags( true );1042 this->setNoOutputPriorPicsFlag( true ); 988 1043 } 989 1044 } … … 1006 1061 #else 1007 1062 //we should only get a different poc for a new picture (with CTU address==0) 1008 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && ( !m_apcSlicePilot->getSliceCurStartCUAddr()==0))1063 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1009 1064 { 1010 1065 printf ("Warning, the first slice of a picture might have been lost!\n"); … … 1050 1105 #endif 1051 1106 } 1052 #if !NO_OUTPUT_OF_PRIOR_PICS1053 #if NO_CLRAS_OUTPUT_FLAG1054 bFirstSliceInSeq = m_bFirstSliceInSequence;1055 #endif1056 #endif1057 1107 m_bFirstSliceInSequence = false; 1108 #if SETTING_NO_OUT_PIC_PRIOR 1109 m_bFirstSliceInBitstream = false; 1110 #endif 1058 1111 #if POC_RESET_FLAG 1059 1112 // This operation would do the following: … … 1216 1269 #endif 1217 1270 1218 #if !NO_OUTPUT_OF_PRIOR_PICS 1219 #if NO_CLRAS_OUTPUT_FLAG 1220 if (m_layerId == 0 && 1221 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1222 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1223 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1224 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1225 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1226 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1227 { 1228 if (bFirstSliceInSeq) 1229 { 1230 setNoClrasOutputFlag(true); 1231 } 1232 else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1233 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1234 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP) 1235 { 1236 setNoClrasOutputFlag(true); 1237 } 1238 #if O0149_CROSS_LAYER_BLA_FLAG 1239 else if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) && 1240 m_apcSlicePilot->getCrossLayerBLAFlag()) 1241 { 1242 setNoClrasOutputFlag(true); 1243 } 1244 #endif 1245 else 1246 { 1247 setNoClrasOutputFlag(false); 1248 } 1249 if (getNoClrasOutputFlag()) 1250 { 1251 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1252 { 1253 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1254 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1255 } 1256 } 1257 } 1258 #endif 1259 1260 #if NO_CLRAS_OUTPUT_FLAG 1261 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1262 #endif 1263 #else 1271 #if NO_OUTPUT_OF_PRIOR_PICS 1264 1272 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1265 1273 { … … 1273 1281 // Buffer initialize for prediction. 1274 1282 m_cPrediction.initTempBuff(); 1275 #if !ALIGNED_BUMPING 1283 #if ALIGNED_BUMPING 1284 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1285 #else 1276 1286 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1277 #else1278 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);1279 1287 #endif 1280 1288 // Get a new picture buffer … … 1809 1817 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1810 1818 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1811 assert(seiAps->activeSeqParam SetId.size()>0);1812 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParam SetId[0] ) )1819 assert(seiAps->activeSeqParameterSetId.size()>0); 1820 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) ) 1813 1821 { 1814 1822 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1837 1845 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1838 1846 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1839 assert(seiAps->activeSeqParam SetId.size()>0);1840 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParam SetId[0] ))1847 assert(seiAps->activeSeqParameterSetId.size()>0); 1848 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1841 1849 { 1842 1850 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1997 2005 return false; 1998 2006 2007 case NAL_UNIT_FILLER_DATA: 2008 return false; 1999 2009 2000 2010 case NAL_UNIT_RESERVED_VCL_N10: … … 2017 2027 case NAL_UNIT_RESERVED_VCL31: 2018 2028 2019 case NAL_UNIT_FILLER_DATA:2020 2029 case NAL_UNIT_RESERVED_NVCL41: 2021 2030 case NAL_UNIT_RESERVED_NVCL42: -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.h
r644 r652 104 104 Bool m_prevSliceSkipped; 105 105 Int m_skippedPOC; 106 #if SETTING_NO_OUT_PIC_PRIOR 107 Bool m_bFirstSliceInBitstream; 108 Int m_lastPOCNoOutputPriorPics; 109 Bool m_isNoOutputPriorPics; 110 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 111 #endif 106 112 107 113 #if SVC_EXTENSION … … 136 142 #endif 137 143 138 #if NO_CLRAS_OUTPUT_FLAG 139 Bool m_noClrasOutputFlag; 144 #if NO_CLRAS_OUTPUT_FLAG 140 145 Bool m_layerInitializedFlag; 141 146 Bool m_firstPicInLayerDecodedFlag; 142 Bool m_noOutputOfPriorPicsFlags; 143 144 Bool m_bRefreshPending; 147 Bool m_bRefreshPending; 145 148 #endif 146 149 #if RESOLUTION_BASED_DPB 147 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to.148 // When new VPS is activated, this should be re-initialized to -1150 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. 151 // When new VPS is activated, this should be re-initialized to -1 149 152 #endif 150 153 public: … … 166 169 Void deletePicBuffer(); 167 170 171 172 TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); } 173 174 168 175 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 176 #if SETTING_NO_OUT_PIC_PRIOR 177 Void checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic); 178 Bool getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; } 179 Void setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; } 180 #endif 181 169 182 #if SVC_EXTENSION 170 183 #if EARLY_REF_PIC_MARKING … … 239 252 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 240 253 #endif 241 #if NO_OUTPUT_OF_PRIOR_PICS242 #if NO_CLRAS_OUTPUT_FLAG243 Bool getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;}244 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; }245 #endif246 #endif247 254 protected: 248 255 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); … … 265 272 266 273 #if NO_CLRAS_OUTPUT_FLAG 267 Int getNoClrasOutputFlag() { return m_ noClrasOutputFlag;}268 Void setNoClrasOutputFlag(Bool x) { m_ noClrasOutputFlag = x; }274 Int getNoClrasOutputFlag() { return m_craNoRaslOutputFlag;} 275 Void setNoClrasOutputFlag(Bool x) { m_craNoRaslOutputFlag = x; } 269 276 Int getLayerInitializedFlag() { return m_layerInitializedFlag;} 270 277 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; } 271 278 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 272 279 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 273 #if !NO_OUTPUT_OF_PRIOR_PICS274 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;}275 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; }276 #endif277 280 #endif 278 281 };// END CLASS DEFINITION TDecTop -
branches/SHM-6-dev/source/Lib/TLibEncoder/AnnexBwrite.h
r595 r652 58 58 59 59 static const Char start_code_prefix[] = {0,0,0,1}; 60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_ SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS) 61 61 { 62 62 /* From AVC, When any of the following conditions are fulfilled, the -
branches/SHM-6-dev/source/Lib/TLibEncoder/NALwrite.cpp
r595 r652 91 91 vector<uint8_t>& rbsp = nalu.m_Bitstream.getFIFO(); 92 92 93 #if P0130_EOB 94 if (rbsp.size() == 0) return; 95 #endif 93 if (rbsp.size() == 0) 94 { 95 return; 96 } 96 97 97 98 for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();) -
branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r644 r652 333 333 Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei) 334 334 { 335 WRITE_CODE(sei.activeVPSId, 4, "active_vps_id");336 WRITE_FLAG(sei.m_ fullRandomAccessFlag, "full_random_access_flag");337 WRITE_FLAG(sei.m_noParam SetUpdateFlag, "no_param_set_update_flag");335 WRITE_CODE(sei.activeVPSId, 4, "active_video_parameter_set_id"); 336 WRITE_FLAG(sei.m_selfContainedCvsFlag, "self_contained_cvs_flag"); 337 WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag"); 338 338 WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1"); 339 339 340 assert (sei.activeSeqParamSetId.size() == (sei.numSpsIdsMinus1 + 1)); 341 342 for (Int i = 0; i < sei.activeSeqParamSetId.size(); i++) 343 { 344 WRITE_UVLC(sei.activeSeqParamSetId[i], "active_seq_param_set_id"); 345 } 346 347 UInt uiBits = m_pcBitIf->getNumberOfWrittenBits(); 348 UInt uiAlignedBits = ( 8 - (uiBits&7) ) % 8; 349 if(uiAlignedBits) 350 { 351 WRITE_FLAG(1, "alignment_bit" ); 352 uiAlignedBits--; 353 while(uiAlignedBits--) 354 { 355 WRITE_FLAG(0, "alignment_bit" ); 356 } 357 } 340 assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1)); 341 342 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 343 { 344 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 345 } 346 xWriteByteAlign(); 358 347 } 359 348 … … 550 539 { 551 540 WRITE_CODE( sei.m_cameraIsoSpeedValue, 32, "camera_iso_speed_value" ); 541 } 542 WRITE_CODE( sei.m_exposureIndexIdc, 8, "exposure_index_idc" ); 543 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 544 { 545 WRITE_CODE( sei.m_exposureIndexValue, 32, "exposure_index_value" ); 552 546 } 553 547 WRITE_FLAG( sei.m_exposureCompensationValueSignFlag, "exposure_compensation_value_sign_flag" ); … … 633 627 for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++) 634 628 { 629 WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" ); 635 630 WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3, "nesting_max_temporal_id" ); 636 631 WRITE_UVLC( sei.m_nestingOpIdx[i], "nesting_op_idx" ); -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r649 r652 1612 1612 if ( pcSlice->getRapPicFlag() ) 1613 1613 { 1614 #if NO_OUTPUT_OF_PRIOR_PICS1615 WRITE_FLAG( pcSlice->getNoOutput OfPriorPicsFlag(), "no_output_of_prior_pics_flag" );1614 #if SETTING_NO_OUT_PIC_PRIOR 1615 WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" ); 1616 1616 #else 1617 1617 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h
r644 r652 235 235 Int m_cameraIsoSpeedIdc; 236 236 Int m_cameraIsoSpeedValue; 237 Int m_exposureIndexIdc; 238 Int m_exposureIndexValue; 237 239 Int m_exposureCompensationValueSignFlag; 238 240 Int m_exposureCompensationValueNumerator; … … 639 641 Void setTMISEICameraIsoSpeedValue(Int b) { m_cameraIsoSpeedValue = b; } 640 642 Int getTMISEICameraIsoSpeedValue() { return m_cameraIsoSpeedValue; } 643 Void setTMISEIExposureIndexIdc(Int b) { m_exposureIndexIdc = b; } 644 Int getTMISEIExposurIndexIdc() { return m_exposureIndexIdc; } 645 Void setTMISEIExposureIndexValue(Int b) { m_exposureIndexValue = b; } 646 Int getTMISEIExposurIndexValue() { return m_exposureIndexValue; } 641 647 Void setTMISEIExposureCompensationValueSignFlag(Int b) { m_exposureCompensationValueSignFlag = b; } 642 648 Int getTMISEIExposureCompensationValueSignFlag() { return m_exposureCompensationValueSignFlag; } -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r644 r652 75 75 m_iNumPicCoded = 0; //Niko 76 76 m_bFirst = true; 77 #if ALLOW_RECOVERY_POINT_AS_RAP 78 m_iLastRecoveryPicPOC = 0; 79 #endif 77 80 78 81 m_pcCfg = NULL; … … 163 166 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); 164 167 seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId(); 165 seiActiveParameterSets->m_ fullRandomAccessFlag = false;166 seiActiveParameterSets->m_noParam SetUpdateFlag = false;168 seiActiveParameterSets->m_selfContainedCvsFlag = false; 169 seiActiveParameterSets->m_noParameterSetUpdateFlag = false; 167 170 seiActiveParameterSets->numSpsIdsMinus1 = 0; 168 seiActiveParameterSets->activeSeqParam SetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);169 seiActiveParameterSets->activeSeqParam SetId[0] = sps->getSPSId();171 seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1); 172 seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId(); 170 173 return seiActiveParameterSets; 171 174 } 172 173 175 174 176 SEIFramePacking* TEncGOP::xCreateSEIFramePacking() … … 271 273 seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue(); 272 274 assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 ); 275 seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc(); 276 seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue(); 277 assert( seiToneMappingInfo->m_exposureIndexValue !=0 ); 273 278 seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag(); 274 279 seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator(); … … 435 440 UInt *accumNalsDU = NULL; 436 441 SEIDecodingUnitInfo decodingUnitInfoSEI; 442 #if EFFICIENT_FIELD_IRAP 443 Int IRAPGOPid = -1; 444 Bool IRAPtoReorder = false; 445 Bool swapIRAPForward = false; 446 if(isField) 447 { 448 Int pocCurr; 449 #if SVC_EXTENSION 450 for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ ) 451 #else 452 for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ ) 453 #endif 454 { 455 // determine actual POC 456 if(iPOCLast == 0) //case first frame or first top field 457 { 458 pocCurr=0; 459 } 460 else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value 461 { 462 pocCurr = 1; 463 } 464 else 465 { 466 pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField; 467 } 468 469 // check if POC corresponds to IRAP 470 NalUnitType tmpUnitType = getNalUnitType(pocCurr, m_iLastIDR, isField); 471 if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP 472 { 473 if(pocCurr%2 == 0 && iGOPid < m_iGopSize-1 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid+1).m_POC-1) 474 { // if top field and following picture in enc order is associated bottom field 475 IRAPGOPid = iGOPid; 476 IRAPtoReorder = true; 477 swapIRAPForward = true; 478 break; 479 } 480 if(pocCurr%2 != 0 && iGOPid > 0 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid-1).m_POC+1) 481 { 482 // if picture is an IRAP remember to process it first 483 IRAPGOPid = iGOPid; 484 IRAPtoReorder = true; 485 swapIRAPForward = false; 486 break; 487 } 488 } 489 } 490 } 491 #endif 437 492 #if SVC_EXTENSION 438 493 for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ ) … … 441 496 #endif 442 497 { 498 #if EFFICIENT_FIELD_IRAP 499 if(IRAPtoReorder) 500 { 501 if(swapIRAPForward) 502 { 503 if(iGOPid == IRAPGOPid) 504 { 505 iGOPid = IRAPGOPid +1; 506 } 507 else if(iGOPid == IRAPGOPid +1) 508 { 509 iGOPid = IRAPGOPid; 510 } 511 } 512 else 513 { 514 if(iGOPid == IRAPGOPid -1) 515 { 516 iGOPid = IRAPGOPid; 517 } 518 else if(iGOPid == IRAPGOPid) 519 { 520 iGOPid = IRAPGOPid -1; 521 } 522 } 523 } 524 #endif 443 525 UInt uiColDir = 1; 444 526 //-- For time output for each slice … … 510 592 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) 511 593 { 594 #if EFFICIENT_FIELD_IRAP 595 if(IRAPtoReorder) 596 { 597 if(swapIRAPForward) 598 { 599 if(iGOPid == IRAPGOPid) 600 { 601 iGOPid = IRAPGOPid +1; 602 IRAPtoReorder = false; 603 } 604 else if(iGOPid == IRAPGOPid +1) 605 { 606 iGOPid --; 607 } 608 } 609 else 610 { 611 if(iGOPid == IRAPGOPid) 612 { 613 iGOPid = IRAPGOPid -1; 614 } 615 else if(iGOPid == IRAPGOPid -1) 616 { 617 iGOPid = IRAPGOPid; 618 IRAPtoReorder = false; 619 } 620 } 621 } 622 #endif 512 623 continue; 513 624 } … … 932 1043 } 933 1044 934 // Do decoding refresh marking if any 935 #if NO_CLRAS_OUTPUT_FLAG 936 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag()); 937 #else 938 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 939 #endif 940 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 941 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 1045 #if EFFICIENT_FIELD_IRAP 942 1046 #if FIX1172 943 1047 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 954 1058 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 955 1059 #endif 956 1060 #endif 1061 // Do decoding refresh marking if any 1062 #if NO_CLRAS_OUTPUT_FLAG 1063 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag()); 1064 #else 1065 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 1066 #endif 1067 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 1068 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 1069 #if EFFICIENT_FIELD_IRAP 1070 #else 1071 #if FIX1172 1072 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1073 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1074 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1075 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1076 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1077 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // IRAP picture 1078 { 1079 m_associatedIRAPType = pcSlice->getNalUnitType(); 1080 m_associatedIRAPPOC = pocCurr; 1081 } 1082 pcSlice->setAssociatedIRAPType(m_associatedIRAPType); 1083 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1084 #endif 1085 #endif 1086 1087 #if ALLOW_RECOVERY_POINT_AS_RAP 1088 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1089 #if EFFICIENT_FIELD_IRAP 1090 || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 1091 #endif 1092 ) 1093 { 1094 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3); 1095 } 1096 #else 957 1097 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP())) 958 1098 { 959 1099 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP()); 960 1100 } 1101 #endif 961 1102 #if ALIGNED_BUMPING 962 1103 pcSlice->checkLeadingPictureRestrictions(rcListPic); … … 1849 1990 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 1850 1991 #if POC_RESET_FLAG 1851 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pocCurr - m_totalCoded; 1852 #else 1853 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1992 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded; 1993 #else 1994 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pcSlice->getPOC() - m_totalCoded; 1995 #endif 1996 #if EFFICIENT_FIELD_IRAP 1997 if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize) 1998 { 1999 // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation 2000 pictureTimingSEI.m_picDpbOutputDelay ++; 2001 } 1854 2002 #endif 1855 2003 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; … … 1975 2123 #endif 1976 2124 sei_recovery_point.m_brokenLinkFlag = false; 2125 #if ALLOW_RECOVERY_POINT_AS_RAP 2126 if(m_pcCfg->getDecodingRefreshType() == 3) 2127 { 2128 m_iLastRecoveryPicPOC = pocCurr; 2129 } 2130 #endif 1977 2131 1978 2132 #if O0164_MULTI_LAYER_HRD … … 2110 2264 } 2111 2265 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2266 2267 #if SETTING_NO_OUT_PIC_PRIOR 2268 if (pcSlice->isIRAP()) 2269 { 2270 if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) 2271 { 2272 pcSlice->setNoRaslOutputFlag(true); 2273 } 2274 //the inference for NoOutputPriorPicsFlag 2275 if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag()) 2276 { 2277 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 2278 { 2279 pcSlice->setNoOutputPriorPicsFlag(true); 2280 } 2281 } 2282 } 2283 #endif 2284 2112 2285 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 2113 2286 m_pcEntropyCoder->encodeSliceHeader(pcSlice); … … 2657 2830 2658 2831 delete[] pcSubstreamsOut; 2832 2833 #if EFFICIENT_FIELD_IRAP 2834 if(IRAPtoReorder) 2835 { 2836 if(swapIRAPForward) 2837 { 2838 if(iGOPid == IRAPGOPid) 2839 { 2840 iGOPid = IRAPGOPid +1; 2841 IRAPtoReorder = false; 2842 } 2843 else if(iGOPid == IRAPGOPid +1) 2844 { 2845 iGOPid --; 2846 } 2847 } 2848 else 2849 { 2850 if(iGOPid == IRAPGOPid) 2851 { 2852 iGOPid = IRAPGOPid -1; 2853 } 2854 else if(iGOPid == IRAPGOPid -1) 2855 { 2856 iGOPid = IRAPGOPid; 2857 IRAPtoReorder = false; 2858 } 2859 } 2860 } 2861 #endif 2659 2862 } 2660 2863 delete pcBitstreamRedirect; … … 2918 3121 case NAL_UNIT_CODED_SLICE_CRA: return "CRA"; 2919 3122 case NAL_UNIT_CODED_SLICE_RADL_R: return "RADL_R"; 3123 case NAL_UNIT_CODED_SLICE_RADL_N: return "RADL_N"; 2920 3124 case NAL_UNIT_CODED_SLICE_RASL_R: return "RASL_R"; 3125 case NAL_UNIT_CODED_SLICE_RASL_N: return "RASL_N"; 2921 3126 case NAL_UNIT_VPS: return "VPS"; 2922 3127 case NAL_UNIT_SPS: return "SPS"; … … 3316 3521 return NAL_UNIT_CODED_SLICE_IDR_W_RADL; 3317 3522 } 3523 #if EFFICIENT_FIELD_IRAP 3524 if(isField && pocCurr == 1) 3525 { 3526 // to avoid the picture becoming an IRAP 3527 return NAL_UNIT_CODED_SLICE_TRAIL_R; 3528 } 3529 #endif 3530 3531 #if ALLOW_RECOVERY_POINT_AS_RAP 3532 if(m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3533 #else 3318 3534 if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3535 #endif 3319 3536 { 3320 3537 if (m_pcCfg->getDecodingRefreshType() == 1) -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.h
r644 r652 82 82 Int m_iNumPicCoded; 83 83 Bool m_bFirst; 84 #if ALLOW_RECOVERY_POINT_AS_RAP 85 Int m_iLastRecoveryPicPOC; 86 #endif 84 87 85 88 // Access channel -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r644 r652 952 952 for (y=0; y<endY; y++) 953 953 { 954 #if SAO_SGN_FUNC 955 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 956 #else 954 957 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 958 #endif 955 959 for (x=startX; x<endX; x++) 956 960 { 961 #if SAO_SGN_FUNC 962 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 963 #else 957 964 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 965 #endif 958 966 edgeType = signRight + signLeft; 959 967 signLeft = -signRight; … … 975 983 for(y=0; y<skipLinesB[typeIdx]; y++) 976 984 { 985 #if SAO_SGN_FUNC 986 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 987 #else 977 988 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 989 #endif 978 990 for (x=startX; x<endX; x++) 979 991 { 992 #if SAO_SGN_FUNC 993 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 994 #else 980 995 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 996 #endif 981 997 edgeType = signRight + signLeft; 982 998 signLeft = -signRight; … … 1026 1042 #endif 1027 1043 { 1044 #if SAO_SGN_FUNC 1045 signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]); 1046 #else 1028 1047 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 1048 #endif 1029 1049 } 1030 1050 … … 1040 1060 #endif 1041 1061 { 1062 #if SAO_SGN_FUNC 1063 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x]); 1064 #else 1042 1065 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 1066 #endif 1043 1067 edgeType = signDown + signUpLine[x]; 1044 1068 signUpLine[x]= -signDown; … … 1065 1089 for (x=startX; x<endX; x++) 1066 1090 { 1091 #if SAO_SGN_FUNC 1092 edgeType = sgn(srcLine[x] - srcLineBelow[x]) + sgn(srcLine[x] - srcLineAbove[x]); 1093 #else 1067 1094 edgeType = m_sign[srcLine[x] - srcLineBelow[x]] + m_sign[srcLine[x] - srcLineAbove[x]]; 1095 #endif 1068 1096 diff [edgeType] += (orgLine[x] - srcLine[x]); 1069 1097 count[edgeType] ++; … … 1108 1136 for (x=startX; x<endX+1; x++) 1109 1137 { 1138 #if SAO_SGN_FUNC 1139 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x-1]); 1140 #else 1110 1141 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x-1]]; 1142 #endif 1111 1143 } 1112 1144 … … 1122 1154 for(x=firstLineStartX; x<firstLineEndX; x++) 1123 1155 { 1156 #if SAO_SGN_FUNC 1157 edgeType = sgn(srcLine[x] - srcLineAbove[x-1]) - signUpLine[x+1]; 1158 #else 1124 1159 edgeType = m_sign[srcLine[x] - srcLineAbove[x-1]] - signUpLine[x+1]; 1160 #endif 1125 1161 diff [edgeType] += (orgLine[x] - srcLine[x]); 1126 1162 count[edgeType] ++; … … 1137 1173 for (x=startX; x<endX; x++) 1138 1174 { 1175 #if SAO_SGN_FUNC 1176 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+1]); 1177 #else 1139 1178 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+1]] ; 1179 #endif 1140 1180 edgeType = signDown + signUpLine[x]; 1141 1181 diff [edgeType] += (orgLine[x] - srcLine[x]); … … 1144 1184 signDownLine[x+1] = -signDown; 1145 1185 } 1186 #if SAO_SGN_FUNC 1187 signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]); 1188 #else 1146 1189 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 1190 #endif 1147 1191 1148 1192 signTmpLine = signUpLine; … … 1168 1212 for (x=startX; x< endX; x++) 1169 1213 { 1214 #if SAO_SGN_FUNC 1215 edgeType = sgn(srcLine[x] - srcLineBelow[x+1]) + sgn(srcLine[x] - srcLineAbove[x-1]); 1216 #else 1170 1217 edgeType = m_sign[srcLine[x] - srcLineBelow[x+1]] + m_sign[srcLine[x] - srcLineAbove[x-1]]; 1218 #endif 1171 1219 diff [edgeType] += (orgLine[x] - srcLine[x]); 1172 1220 count[edgeType] ++; … … 1206 1254 for (x=startX-1; x<endX; x++) 1207 1255 { 1256 #if SAO_SGN_FUNC 1257 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]); 1258 #else 1208 1259 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 1260 #endif 1209 1261 } 1210 1262 … … 1225 1277 for(x=firstLineStartX; x<firstLineEndX; x++) 1226 1278 { 1279 #if SAO_SGN_FUNC 1280 edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) - signUpLine[x-1]; 1281 #else 1227 1282 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] - signUpLine[x-1]; 1283 #endif 1228 1284 diff [edgeType] += (orgLine[x] - srcLine[x]); 1229 1285 count[edgeType] ++; … … 1240 1296 for(x=startX; x<endX; x++) 1241 1297 { 1298 #if SAO_SGN_FUNC 1299 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]); 1300 #else 1242 1301 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 1302 #endif 1243 1303 edgeType = signDown + signUpLine[x]; 1244 1304 … … 1248 1308 signUpLine[x-1] = -signDown; 1249 1309 } 1310 #if SAO_SGN_FUNC 1311 signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]); 1312 #else 1250 1313 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 1314 #endif 1251 1315 srcLine += srcStride; 1252 1316 orgLine += orgStride; … … 1267 1331 for (x=startX; x<endX; x++) 1268 1332 { 1333 #if SAO_SGN_FUNC 1334 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + sgn(srcLine[x] - srcLineAbove[x+1]); 1335 #else 1269 1336 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + m_sign[srcLine[x] - srcLineAbove[x+1]]; 1337 #endif 1270 1338 diff [edgeType] += (orgLine[x] - srcLine[x]); 1271 1339 count[edgeType] ++; -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSbac.h
r644 r652 95 95 Void codeSliceHeader ( TComSlice* pcSlice ); 96 96 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 #if POC_RESET_IDC_SIGNALLING98 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow );99 #endif100 97 Void codeTerminatingBit ( UInt uilsLast ); 101 98 Void codeSliceFinish (); … … 108 105 109 106 #if SVC_EXTENSION 107 #if POC_RESET_IDC_SIGNALLING 108 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ); 109 #endif 110 110 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal); 111 111 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r595 r652 2398 2398 { 2399 2399 UInt uiDepth = pcCU->getDepth(0); 2400 UInt uiNumPU = pcCU->getNumPart Inter();2400 UInt uiNumPU = pcCU->getNumPartitions(); 2401 2401 UInt uiInitTrDepth = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; 2402 2402 UInt uiWidth = pcCU->getWidth (0) >> uiInitTrDepth; … … 3130 3130 TComMv cMvTemp[2][33]; 3131 3131 3132 Int iNumPart = pcCU->getNumPart Inter();3132 Int iNumPart = pcCU->getNumPartitions(); 3133 3133 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 3134 3134 … … 4612 4612 4613 4613 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4614 #if 0 // check 4615 { 4616 m_pcEntropyCoder->resetBits(); 4617 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0) ); 4618 const UInt uiBitsForCoeff = m_pcEntropyCoder->getNumberOfWrittenBits(); 4619 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4620 if( uiBitsForCoeff != uiBits ) 4621 assert( 0 ); 4622 } 4623 #endif 4614 4624 4615 uiBits = 0; 4625 4616 { -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r644 r652 225 225 Int depth; 226 226 { 227 #if FIX_FIELD_DEPTH 228 Int poc = rpcSlice->getPOC(); 229 if(isField) 230 { 231 poc = (poc/2)%(m_pcCfg->getGOPSize()/2); 232 } 233 else 234 { 235 poc = poc%m_pcCfg->getGOPSize(); 236 } 237 #else 227 238 Int poc = rpcSlice->getPOC()%m_pcCfg->getGOPSize(); 239 #endif 228 240 if ( poc == 0 ) 229 241 { … … 248 260 } 249 261 } 262 #if FIX_FIELD_DEPTH 263 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 264 if(poc != 0) 265 { 266 #endif 267 if(isField && rpcSlice->getPOC()%2 == 1) 268 { 269 depth ++; 270 } 271 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 272 } 273 #endif 274 #endif 250 275 } 251 276 … … 254 279 255 280 eSliceType=B_SLICE; 281 #if EFFICIENT_FIELD_IRAP 282 if(!(isField && pocLast == 1)) 283 { 284 #endif // EFFICIENT_FIELD_IRAP 285 #if ALLOW_RECOVERY_POINT_AS_RAP 286 if(m_pcCfg->getDecodingRefreshType() == 3) 287 { 288 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 289 } 290 else 291 { 256 292 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 293 } 294 #else 295 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 296 #endif 297 #if EFFICIENT_FIELD_IRAP 298 } 299 #endif 257 300 258 301 rpcSlice->setSliceType ( eSliceType ); … … 423 466 #if HB_LAMBDA_FOR_LDC 424 467 // restore original slice type 468 469 #if EFFICIENT_FIELD_IRAP 470 if(!(isField && pocLast == 1)) 471 { 472 #endif // EFFICIENT_FIELD_IRAP 473 #if ALLOW_RECOVERY_POINT_AS_RAP 474 if(m_pcCfg->getDecodingRefreshType() == 3) 475 { 476 eSliceType = (pocLast == 0 || (pocCurr) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 477 478 } 479 else 480 { 425 481 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 482 } 483 #else 484 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 485 #endif 486 #if EFFICIENT_FIELD_IRAP 487 } 488 #endif // EFFICIENT_FIELD_IRAP 426 489 427 490 #if SVC_EXTENSION … … 544 607 // store lambda 545 608 slice->setSliceQp( sliceQP ); 609 #if ADAPTIVE_QP_SELECTION 546 610 slice->setSliceQpBase ( sliceQP ); 611 #endif 547 612 m_pcRdCost ->setLambda( lambda ); 548 613 // for RDO … … 1041 1106 1042 1107 m_pcRateCtrl->setRCQP( estQP ); 1108 #if ADAPTIVE_QP_SELECTION 1043 1109 pcCU->getSlice()->setSliceQpBase( estQP ); 1110 #endif 1044 1111 } 1045 1112 -
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.h
r644 r652 273 273 274 274 /// encode several number of pictures until end-of-sequence 275 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,275 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 276 276 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff); 277 277
Note: See TracChangeset for help on using the changeset viewer.