Changeset 713 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 21 Apr 2014, 04:44:16 (11 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev (added) merged: 651-712
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source (added) merged: 652-678,680,683-684,686-691,693-700,702-705,707-711
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r644 r713 58 58 #if SVC_EXTENSION 59 59 #include <vector> 60 #define NV_VERSION " 5.1 (HM-13.0)" ///< Current software version60 #define NV_VERSION "6.0 (HM-14.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 -
trunk/source/Lib/TLibCommon/SEI.h
r644 r713 79 79 #endif 80 80 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 81 INTER_LAYER_CONSTRAINED_TILE_SETS = 138 81 INTER_LAYER_CONSTRAINED_TILE_SETS = 138, 82 82 #endif 83 83 #if SUB_BITSTREAM_PROPERTY_SEI 84 ,SUB_BITSTREAM_PROPERTY = 139// Final PayloadType to be defined after finalization84 SUB_BITSTREAM_PROPERTY = 139, // Final PayloadType to be defined after finalization 85 85 #endif 86 86 #if O0164_MULTI_LAYER_HRD 87 ,BSP_NESTING = 140 88 ,BSP_INITIAL_ARRIVAL_TIME = 141 89 ,BSP_HRD = 142 87 BSP_NESTING = 140, 88 BSP_INITIAL_ARRIVAL_TIME = 141, 89 BSP_HRD = 142, 90 #endif 91 #if Q0074_SEI_COLOR_MAPPING 92 COLOR_MAPPING_INFO = 143, 90 93 #endif 91 94 }; … … 142 145 SEIActiveParameterSets() 143 146 : activeVPSId (0) 144 , m_ fullRandomAccessFlag (false)145 , m_noParam SetUpdateFlag (false)147 , m_selfContainedCvsFlag (false) 148 , m_noParameterSetUpdateFlag (false) 146 149 , numSpsIdsMinus1 (0) 147 150 {} … … 149 152 150 153 Int activeVPSId; 151 Bool m_ fullRandomAccessFlag;152 Bool m_noParam SetUpdateFlag;154 Bool m_selfContainedCvsFlag; 155 Bool m_noParameterSetUpdateFlag; 153 156 Int numSpsIdsMinus1; 154 std::vector<Int> activeSeqParam SetId;157 std::vector<Int> activeSeqParameterSetId; 155 158 }; 156 159 … … 393 396 Int m_cameraIsoSpeedIdc; 394 397 Int m_cameraIsoSpeedValue; 398 Int m_exposureIndexIdc; 399 Int m_exposureIndexValue; 395 400 Int m_exposureCompensationValueSignFlag; 396 401 Int m_exposureCompensationValueNumerator; … … 402 407 Int m_extendedWhiteLevelLumaCodeValue; 403 408 }; 409 410 #if Q0074_SEI_COLOR_MAPPING 411 class SEIColorMappingInfo : public SEI 412 { 413 public: 414 PayloadType payloadType() const { return COLOR_MAPPING_INFO; } 415 SEIColorMappingInfo() { 416 } 417 virtual ~SEIColorMappingInfo() {} 418 419 Int m_colorMapId; 420 Bool m_colorMapCancelFlag; 421 Bool m_colorMapPersistenceFlag; 422 Bool m_colorMap_video_signal_type_present_flag; 423 Bool m_colorMap_video_full_range_flag; 424 Int m_colorMap_primaries; 425 Int m_colorMap_transfer_characteristics; 426 Int m_colorMap_matrix_coeffs; 427 Int m_colorMapModelId; 428 429 Int m_colour_map_coded_data_bit_depth; 430 Int m_colour_map_target_bit_depth; 431 432 Int m_num_input_pivots[3]; 433 Int* m_coded_input_pivot_value[3]; 434 Int* m_target_input_pivot_value[3]; 435 436 Bool m_matrix_flag; 437 Int m_log2_matrix_denom; 438 Int m_matrix_coef[3][3]; 439 440 Int m_num_output_pivots[3]; 441 Int* m_coded_output_pivot_value[3]; 442 Int* m_target_output_pivot_value[3]; 443 }; 444 #endif 404 445 405 446 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r595 r713 172 172 memset( m_pcTrCoeffCb, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) ); 173 173 memset( m_pcTrCoeffCr, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) ); 174 #if ADAPTIVE_QP_SELECTION 174 #if ADAPTIVE_QP_SELECTION 175 175 if( bGlobalRMARLBuffer ) 176 176 { 177 177 if( m_pcGlbArlCoeffY == NULL ) 178 178 { 179 #if LAYER_CTB 180 m_pcGlbArlCoeffY = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE); 181 m_pcGlbArlCoeffCb = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4); 182 m_pcGlbArlCoeffCr = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4); 183 #else 179 184 m_pcGlbArlCoeffY = (Int*)xMalloc(Int, uiWidth*uiHeight); 180 185 m_pcGlbArlCoeffCb = (Int*)xMalloc(Int, uiWidth*uiHeight/4); 181 186 m_pcGlbArlCoeffCr = (Int*)xMalloc(Int, uiWidth*uiHeight/4); 187 #endif 182 188 } 183 189 m_pcArlCoeffY = m_pcGlbArlCoeffY; … … 1690 1696 } 1691 1697 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 1698 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) 1757 1699 { … … 1809 1751 return log2MinTUSizeInCU; 1810 1752 } 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 1753 1875 1754 UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx ) … … 2168 2047 } 2169 2048 2170 UChar TComDataCU::getNumPart Inter()2049 UChar TComDataCU::getNumPartitions() 2171 2050 { 2172 2051 UChar iNumPart = 0; … … 3612 3491 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping ) 3613 3492 { 3614 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc);3493 TComPic* baseColPic = m_pcSlice->getBaseColPic(refLayerIdc); 3615 3494 3616 3495 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); … … 3622 3501 3623 3502 #if O0098_SCALED_REF_LAYER_ID 3624 Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();3625 Int topStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();3503 Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); 3504 Int topStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset(); 3626 3505 #else 3627 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 3628 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3629 #endif 3506 Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 3507 Int topStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3508 #endif 3509 3510 #if Q0200_CONFORMANCE_BL_SIZE 3511 Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc(); 3512 Int iBX = (((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc ); 3513 Int iBY = (((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc ); 3514 #else 3630 3515 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 3631 3516 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 3517 #endif 3632 3518 3633 3519 #if N0139_POSITION_ROUNDING_OFFSET 3634 3520 if( iMotionMapping == 1 ) 3635 3521 { 3636 iBX += 4;3637 iB Y +=4;3638 }3639 #endif 3640 3641 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || 3642 iBX < 0 || iBY < 0)3522 // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check. 3523 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3524 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3525 } 3526 #endif 3527 3528 if ( iBX < 0 || iBX >= baseColPic->getPicYuvRec()->getWidth() || iBY < 0 || iBY >= baseColPic->getPicYuvRec()->getHeight() ) 3643 3529 { 3644 3530 return NULL; … … 3646 3532 3647 3533 #if LAYER_CTB 3648 UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight();3649 UInt baseMaxCUWidth = cBaseColPic->getPicSym()->getMaxCUWidth();3650 UInt baseMinUnitSize = cBaseColPic->getMinCUWidth();3651 3652 uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth());3534 UInt baseMaxCUHeight = baseColPic->getPicSym()->getMaxCUHeight(); 3535 UInt baseMaxCUWidth = baseColPic->getPicSym()->getMaxCUWidth(); 3536 UInt baseMinUnitSize = baseColPic->getMinCUWidth(); 3537 3538 uiCUAddrBase = ( iBY / baseMaxCUHeight ) * baseColPic->getFrameWidthInCU() + ( iBX / baseMaxCUWidth ); 3653 3539 #else 3654 uiCUAddrBase = (iBY/g_uiMaxCUHeight)* cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);3655 #endif 3656 3657 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());3540 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*baseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 3541 #endif 3542 3543 assert(uiCUAddrBase < baseColPic->getNumCUsInFrame()); 3658 3544 3659 3545 #if LAYER_CTB 3660 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;3661 3662 uiAbsPartIdxBase = g_auiLayerRasterToZscan[ cBaseColPic->getLayerId()][uiRasterAddrBase];3546 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * baseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize; 3547 3548 uiAbsPartIdxBase = g_auiLayerRasterToZscan[baseColPic->getLayerId()][uiRasterAddrBase]; 3663 3549 #else 3664 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize* cBaseColPic->getNumPartInWidth()3550 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*baseColPic->getNumPartInWidth() 3665 3551 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 3666 3552 … … 3668 3554 #endif 3669 3555 3670 return cBaseColPic->getCU(uiCUAddrBase);3556 return baseColPic->getCU(uiCUAddrBase); 3671 3557 } 3672 3558 … … 3680 3566 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 3681 3567 } 3568 3569 #if FAST_INTRA_SHVC 3570 /** generate limited set of remaining modes 3571 *\param uiAbsPartIdx 3572 *\param uiIntraDirPred pointer to the array for MPM storage 3573 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs) 3574 */ 3575 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ) 3576 { 3577 // check BL mode 3578 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0; 3579 // the right reference layerIdc should be specified, currently it is set to m_layerId-1 3580 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 ); 3581 3582 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) 3583 { 3584 return( NUM_INTRA_MODE-1 ); 3585 } 3586 3587 // compute set of enabled modes g_reducedSetIntraModes[...] 3588 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}; 3589 Int nbModes; 3590 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st 3591 { 3592 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes]; 3593 authorizedMode[ uiIntraDirPred[nbModes] ] = 0; 3594 } 3595 3596 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase ); 3597 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode 3598 { 3599 g_reducedSetIntraModes[nbModes++] = iColBaseDir; 3600 authorizedMode[ iColBaseDir ] = 0; 3601 } 3602 3603 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0]; 3604 if ( iRefMode > 1 ) //add neighboring modes of refMode 3605 { 3606 UInt Left = iRefMode; 3607 UInt Right = iRefMode; 3608 while ( nbModes < NB_REMAIN_MODES+3 ) 3609 { 3610 Left = ((Left + 29) % 32) + 2; 3611 Right = ((Right - 1 ) % 32) + 2; 3612 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left; 3613 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right; 3614 } 3615 } 3616 else //add pre-defined modes 3617 { 3618 Int idx = 0; 3619 while ( nbModes < NB_REMAIN_MODES+3 ) 3620 { 3621 UInt mode = g_predefSetIntraModes[idx++]; 3622 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode; 3623 } 3624 } 3625 3626 fullSetOfModes = 0; 3627 return ( nbModes ); 3628 } 3629 #endif 3630 3631 #if REF_IDX_ME_ZEROMV 3632 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3633 { 3634 Bool checkZeroMVILR = true; 3635 3636 if(uhInterDir&0x1) //list0 3637 { 3638 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3639 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 3640 { 3641 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3642 } 3643 } 3644 if(uhInterDir&0x2) //list1 3645 { 3646 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3647 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 3648 { 3649 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3650 } 3651 } 3652 3653 return checkZeroMVILR; 3654 } 3655 3656 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx) 3657 { 3658 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0; 3659 assert(eRefPicList == REF_PIC_LIST_1); 3660 3661 Bool checkZeroMVILR = true; 3662 3663 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId)) 3664 { 3665 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); 3666 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx]; 3667 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0); 3668 } 3669 3670 return checkZeroMVILR; 3671 } 3672 #endif 3673 3674 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3675 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3676 { 3677 Bool checkILR = false; 3678 3679 if(uhInterDir&0x1) //list0 3680 { 3681 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3682 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId); 3683 } 3684 if(uhInterDir&0x2) //list1 3685 { 3686 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3687 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId); 3688 } 3689 3690 return checkILR; 3691 } 3692 #endif 3693 3682 3694 #endif //SVC_EXTENSION 3683 3695 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.h
r595 r713 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 -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r595 r713 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 -
trunk/source/Lib/TLibCommon/TComPic.h
r595 r713 89 89 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; // upsampled base layer recontruction for difference domain inter prediction 90 90 #endif 91 #if Q0048_CGS_3D_ASYMLUT 92 Int m_nFrameBit; 93 #endif 91 94 92 95 public: … … 115 118 UInt getTLayer() { return m_uiTLayer; } 116 119 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 120 117 121 Bool getUsedByCurr() { return m_bUsedByCurr; } 118 122 Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } … … 219 223 #endif 220 224 225 #if Q0048_CGS_3D_ASYMLUT 226 Void setFrameBit( Int n ) { m_nFrameBit = n; } 227 Int getFrameBit() { return m_nFrameBit; } 228 #endif 221 229 };// END CLASS DEFINITION TComPic 222 230 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r595 r713 174 174 Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0); 175 175 176 #if LAYER_CTB 177 m_iLumaMarginX = uiMaxCUWidth + 16; // for 16-byte alignment 178 m_iLumaMarginY = uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 179 #else 176 180 m_iLumaMarginX = g_uiMaxCUWidth + 16; // for 16-byte alignment 177 181 m_iLumaMarginY = g_uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 182 #endif 178 183 179 184 m_apiPicBufY = (Pel*)xMalloc( Pel, ( m_iPicWidth + (m_iLumaMarginX <<1)) * ( m_iPicHeight + (m_iLumaMarginY <<1))); -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r644 r713 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 ); … … 768 768 #if O0215_PHASE_ALIGNMENT 769 769 #if O0194_JOINT_US_BITSHIFT 770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag )771 { 772 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window,phaseAlignFlag );770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ) 771 { 772 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, phaseAlignFlag ); 773 773 } 774 774 #else -
trunk/source/Lib/TLibCommon/TComPrediction.h
r644 r713 121 121 #if O0215_PHASE_ALIGNMENT 122 122 #if O0194_JOINT_US_BITSHIFT 123 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag );123 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ); 124 124 #else 125 125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r644 r713 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 -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r644 r713 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]; -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r644 r713 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 ) … … 536 536 { 537 537 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 538 UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ); 538 539 #if RESAMPLING_CONSTRAINT_BUG_FIX 539 540 #if O0098_SCALED_REF_LAYER_ID 540 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer( m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] ));541 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 541 542 #else 542 543 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); … … 548 549 ); 549 550 #endif 551 #if O0194_DIFFERENT_BITDEPTH_EL_BL 552 Int sameBitDepth = g_bitDepthYLayer[m_layerId] - g_bitDepthYLayer[refLayerId] + g_bitDepthCLayer[m_layerId] - g_bitDepthCLayer[refLayerId]; 553 554 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepth 555 #if Q0048_CGS_3D_ASYMLUT 556 || getPPS()->getCGSFlag() 557 #endif 558 ) // ratio 1x 559 #else 550 560 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x 561 #endif 551 562 { 552 563 #if MOTION_RESAMPLING_CONSTRAINT 553 UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, m_pcVPS->getRefLayerId( m_layerId, refLayerIdc )) + 1;564 UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, refLayerId ) + 1; 554 565 555 566 if( predType & 0x1 ) … … 596 607 // 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 608 #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.609 // - 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. 610 // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 600 611 if (getRapPicFlag() && getLayerId()==0) 601 612 #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.613 // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 614 // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 604 615 if (getRapPicFlag()) 605 616 #endif … … 1008 1019 */ 1009 1020 #if NO_CLRAS_OUTPUT_FLAG 1021 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ) 1022 { 1023 if( !isIRAP() ) 1024 { 1025 return; 1026 } 1027 1028 Int pocCurr = getPOC(); 1029 TComPic* rpcPic = NULL; 1030 1031 // When the current picture is an IRAP picture with nuh_layer_id equal to 0 and NoClrasOutputFlag is equal to 1, 1032 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference". 1033 if( m_layerId == 0 && noClrasOutputFlag ) 1034 { 1035 // mark all pictures for all layers as not used for reference 1036 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1037 while( iterPic != rcListPic.end() ) 1038 { 1039 rpcPic = *(iterPic); 1040 if( rpcPic->getPOC() != pocCurr ) 1041 { 1042 rpcPic->getSlice(0)->setReferenced(false); 1043 } 1044 iterPic++; 1045 } 1046 } 1047 1048 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 1049 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the DPB (if any) are marked as "unused for reference". 1050 if( m_noRaslOutputFlag ) 1051 { 1052 // mark all pictures of a current layer as not used for reference 1053 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1054 while( iterPic != rcListPic.end() ) 1055 { 1056 rpcPic = *(iterPic); 1057 if( rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId ) 1058 { 1059 rpcPic->getSlice(0)->setReferenced(false); 1060 } 1061 iterPic++; 1062 } 1063 } 1064 } 1065 1010 1066 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag) 1011 1067 #else … … 1051 1107 pocCRA = pocCurr; 1052 1108 } 1109 #if EFFICIENT_FIELD_IRAP 1110 bRefreshPending = true; 1111 #endif 1053 1112 } 1054 1113 else // CRA or No DR 1055 1114 { 1115 #if EFFICIENT_FIELD_IRAP 1116 if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1117 { 1118 if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending 1119 { 1120 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1121 while (iterPic != rcListPic.end()) 1122 { 1123 rpcPic = *(iterPic); 1124 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR) 1125 { 1126 rpcPic->getSlice(0)->setReferenced(false); 1127 } 1128 iterPic++; 1129 } 1130 bRefreshPending = false; 1131 } 1132 } 1133 else 1134 { 1135 #endif 1056 1136 if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending 1057 1137 { … … 1068 1148 bRefreshPending = false; 1069 1149 } 1150 #if EFFICIENT_FIELD_IRAP 1151 } 1152 #endif 1070 1153 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 1071 1154 { … … 1323 1406 // in decoding order shall precede the IRAP picture in output order. 1324 1407 // (Note that any picture following in output order would be present in the DPB) 1408 #if !SETTING_NO_OUT_PIC_PRIOR 1325 1409 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1410 #else 1411 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag()) 1412 #endif 1326 1413 { 1327 1414 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || … … 1502 1589 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1503 1590 */ 1591 #if ALLOW_RECOVERY_POINT_AS_RAP 1592 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint) 1593 #else 1504 1594 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess) 1505 { 1595 #endif 1596 { 1597 #if ALLOW_RECOVERY_POINT_AS_RAP 1598 Int atLeastOneUnabledByRecoveryPoint = 0; 1599 Int atLeastOneFlushedByPreviousIDR = 0; 1600 #endif 1506 1601 TComPic* rpcPic; 1507 1602 Int i, isAvailable; … … 1524 1619 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1525 1620 { 1621 #if ALLOW_RECOVERY_POINT_AS_RAP 1622 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1623 { 1624 isAvailable = 0; 1625 } 1626 else 1627 { 1526 1628 isAvailable = 1; 1629 } 1630 #else 1631 isAvailable = 1; 1632 #endif 1527 1633 } 1528 1634 } … … 1534 1640 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1535 1641 { 1642 #if ALLOW_RECOVERY_POINT_AS_RAP 1643 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1644 { 1645 isAvailable = 0; 1646 } 1647 else 1648 { 1536 1649 isAvailable = 1; 1650 } 1651 #else 1652 isAvailable = 1; 1653 #endif 1537 1654 } 1538 1655 } … … 1557 1674 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1558 1675 { 1676 #if ALLOW_RECOVERY_POINT_AS_RAP 1677 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1678 { 1679 isAvailable = 0; 1680 } 1681 else 1682 { 1559 1683 isAvailable = 1; 1560 1684 rpcPic->setIsLongTerm(1); 1561 1685 break; 1686 } 1687 #else 1688 isAvailable = 1; 1689 rpcPic->setIsLongTerm(1); 1690 break; 1691 #endif 1562 1692 } 1563 1693 } … … 1587 1717 } 1588 1718 } 1719 #if ALLOW_RECOVERY_POINT_AS_RAP 1720 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1721 { 1722 atLeastOneUnabledByRecoveryPoint = 1; 1723 } 1724 else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL)) 1725 { 1726 atLeastOneFlushedByPreviousIDR = 1; 1727 } 1728 #endif 1589 1729 } 1590 1730 } … … 1602 1742 if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1603 1743 { 1744 #if ALLOW_RECOVERY_POINT_AS_RAP 1745 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1746 { 1747 isAvailable = 0; 1748 } 1749 else 1750 { 1604 1751 isAvailable = 1; 1752 } 1753 #else 1754 isAvailable = 1; 1755 #endif 1605 1756 } 1606 1757 } … … 1629 1780 } 1630 1781 } 1631 } 1782 #if ALLOW_RECOVERY_POINT_AS_RAP 1783 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1784 { 1785 atLeastOneUnabledByRecoveryPoint = 1; 1786 } 1787 else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL)) 1788 { 1789 atLeastOneFlushedByPreviousIDR = 1; 1790 } 1791 #endif 1792 } 1793 } 1794 #if ALLOW_RECOVERY_POINT_AS_RAP 1795 if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR) 1796 { 1797 return -1; 1632 1798 } 1799 #endif 1633 1800 if(atLeastOneLost) 1634 1801 { … … 1647 1814 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1648 1815 */ 1816 #if ALLOW_RECOVERY_POINT_AS_RAP 1817 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint) 1818 #else 1649 1819 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1820 #endif 1650 1821 { 1651 1822 TComPic* rpcPic; … … 1673 1844 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1674 1845 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1846 #if ALLOW_RECOVERY_POINT_AS_RAP 1847 pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) ); 1848 #endif 1675 1849 if(pcRPS->getDeltaPOC(k) < 0) 1676 1850 { … … 1685 1859 } 1686 1860 } 1861 #if EFFICIENT_FIELD_IRAP 1862 Bool useNewRPS = false; 1863 // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS. 1864 if(m_pcPic->isField()) 1865 { 1866 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1867 while ( iterPic != rcListPic.end()) 1868 { 1869 rpcPic = *(iterPic++); 1870 if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1) 1871 { 1872 pcRPS->setDeltaPOC(k, 1); 1873 pcRPS->setUsed(k, true); 1874 nrOfPositivePictures++; 1875 k ++; 1876 useNewRPS = true; 1877 } 1878 } 1879 } 1880 #endif 1687 1881 pcRPS->setNumberOfNegativePictures(nrOfNegativePictures); 1688 1882 pcRPS->setNumberOfPositivePictures(nrOfPositivePictures); … … 1691 1885 // inter RPS prediction with. Here we just use the reference used by pReferencePictureSet. 1692 1886 // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled. 1693 if (!pReferencePictureSet->getInterRPSPrediction()) 1887 if (!pReferencePictureSet->getInterRPSPrediction() 1888 #if EFFICIENT_FIELD_IRAP 1889 || useNewRPS 1890 #endif 1891 ) 1694 1892 { 1695 1893 pcRPS->setInterRPSPrediction(false); … … 1888 2086 if( layerId == 0 ) 1889 2087 { 1890 retVal = sps->getChromaFormatIdc(); 2088 if( vps->getAvcBaseLayerFlag() ) 2089 { 2090 retVal = vps->getVpsRepFormat(layerId)->getChromaFormatVpsIdc(); 2091 } 2092 else 2093 { 2094 retVal = sps->getChromaFormatIdc(); 2095 } 1891 2096 } 1892 2097 else … … 2034 2239 #endif 2035 2240 #if REPN_FORMAT_IN_VPS 2241 #if Q0195_REP_FORMAT_CLEANUP 2242 , m_repFormatIdxPresentFlag (false) 2243 #else 2036 2244 , m_repFormatIdxPresentFlag (true) 2245 #endif 2037 2246 , m_vpsNumRepFormats (1) 2038 2247 #endif … … 2306 2515 Void TComVPS::setRefLayersFlags(Int currLayerId) 2307 2516 { 2308 for (Int i = 0; i < getNumDirectRefLayers(currLayerId); i++)2517 for (Int i = 0; i < m_numDirectRefLayers[currLayerId]; i++) 2309 2518 { 2310 2519 UInt refLayerId = getRefLayerId(currLayerId, i); 2311 setRecursiveRefLayerFlag(currLayerId, refLayerId, true);2520 m_recursiveRefLayerFlag[currLayerId][refLayerId] = true; 2312 2521 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++) 2313 2522 { 2314 setRecursiveRefLayerFlag(currLayerId, k, (getRecursiveRefLayerFlag(currLayerId, k) | getRecursiveRefLayerFlag(refLayerId, k)));2523 m_recursiveRefLayerFlag[currLayerId][k] = m_recursiveRefLayerFlag[currLayerId][k] | m_recursiveRefLayerFlag[refLayerId][k]; 2315 2524 } 2316 2525 } … … 2319 2528 Void TComVPS::setNumRefLayers(Int currLayerId) 2320 2529 { 2321 for (Int i = 0; i < = getMaxLayers(); i++)2322 { 2323 UInt iNuhLId = getLayerIdInNuh(i);2530 for (Int i = 0; i < m_uiMaxLayers; i++) 2531 { 2532 UInt iNuhLId = m_layerIdInNuh[i]; 2324 2533 setRefLayersFlags(iNuhLId); 2325 2534 for (UInt j = 0; j < MAX_NUM_LAYER_IDS; j++) 2326 2535 { 2327 m_numberRefLayers[iNuhLId] += ( getRecursiveRefLayerFlag(iNuhLId, j)== true ? 1 : 0);2536 m_numberRefLayers[iNuhLId] += (m_recursiveRefLayerFlag[iNuhLId][j] == true ? 1 : 0); 2328 2537 } 2329 2538 } … … 3526 3735 3527 3736 TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc]; 3737 3528 3738 //set reference picture POC of each ILP reference 3529 3739 Int thePoc = ilpPic[refLayerIdc]->getPOC(); … … 3532 3742 ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL ); 3533 3743 3534 //copy reference pictures marking from the reference layer 3535 ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 3744 //copy layer id from the reference layer 3745 ilpPic[refLayerIdc]->setLayerId( pcRefPicBL->getLayerId() ); 3746 3747 //copy slice type from the reference layer 3748 ilpPic[refLayerIdc]->getSlice(0)->setSliceType( pcRefPicBL->getSlice(0)->getSliceType() ); 3749 3750 //copy "used for reference" 3751 ilpPic[refLayerIdc]->getSlice(0)->setReferenced( pcRefPicBL->getSlice(0)->isReferenced() ); 3536 3752 3537 3753 for( Int refList = 0; refList < 2; refList++ ) … … 3555 3771 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 3556 3772 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 3773 } 3774 3775 //copy reference pictures' marking from the reference layer 3776 for(Int j = 0; j < MAX_NUM_REF + 1; j++) 3777 { 3778 ilpPic[refLayerIdc]->getSlice(0)->setIsUsedAsLongTerm(refList, j, pcRefPicBL->getSlice(0)->getIsUsedAsLongTerm(refList, j)); 3557 3779 } 3558 3780 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r644 r713 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]; … … 581 581 #if VPS_TSLAYERS 582 582 Bool m_maxTSLayersPresentFlag; 583 UInt m_maxTSLayerMinus1[MAX_ VPS_LAYER_ID_PLUS1 - 1];583 UInt m_maxTSLayerMinus1[MAX_LAYERS]; 584 584 #endif 585 585 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 684 684 Bool m_vpsVuiPresentFlag; 685 685 #endif 686 Bool m_vpsExtensionFlag; 686 687 687 688 #if O0164_MULTI_LAYER_HRD … … 1131 1132 1132 1133 #if O0109_MOVE_VPS_VUI_FLAG 1133 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1134 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1135 #endif 1134 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1135 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1136 #endif 1137 Bool getVpsExtensionFlag() { return m_vpsExtensionFlag; } 1138 Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } 1136 1139 1137 1140 #if !P0307_REMOVE_VPS_VUI_OFFSET … … 1741 1744 Bool m_pocResetInfoPresentFlag; 1742 1745 #endif 1746 #if Q0048_CGS_3D_ASYMLUT 1747 Int m_nCGSFlag; 1748 Int m_nCGSOutputBitDepthY; // not for syntax 1749 Int m_nCGSOutputBitDepthC; // not for syntax 1750 #endif 1743 1751 #endif 1744 1752 … … 1881 1889 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } 1882 1890 Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } 1891 #endif 1892 #if Q0048_CGS_3D_ASYMLUT 1893 Int getCGSFlag() { return m_nCGSFlag; } 1894 Void setCGSFlag(Int n) { m_nCGSFlag = n; } 1895 Int getCGSOutputBitDepthY() { return m_nCGSOutputBitDepthY; } 1896 Void setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n; } 1897 Int getCGSOutputBitDepthC() { return m_nCGSOutputBitDepthC; } 1898 Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n; } 1883 1899 #endif 1884 1900 }; … … 1963 1979 UInt m_colFromL0Flag; // collocated picture from List0 flag 1964 1980 1981 #if SETTING_NO_OUT_PIC_PRIOR 1982 Bool m_noOutputPriorPicsFlag; 1983 Bool m_noRaslOutputFlag; 1984 Bool m_handleCraAsBlaFlag; 1985 #endif 1986 1965 1987 UInt m_colRefIdx; 1966 1988 UInt m_maxNumMergeCand; … … 2030 2052 Bool m_bCrossLayerBLAFlag; 2031 2053 #endif 2032 #if NO_OUTPUT_OF_PRIOR_PICS2033 Bool m_noOutputOfPriorPicsFlag;2034 Bool m_noRaslOutputFlag;2035 Bool m_handleCraAsBlaFlag;2036 #endif2037 2054 #if POC_RESET_IDC_SIGNALLING 2038 2055 Int m_pocResetIdc; … … 2043 2060 Bool m_pocMsbValRequiredFlag; 2044 2061 Bool m_pocMsbValPresentFlag; 2062 #endif 2063 #if Q0048_CGS_3D_ASYMLUT 2064 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream 2045 2065 #endif 2046 2066 #endif //SVC_EXTENSION … … 2130 2150 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 2131 2151 Bool getRapPicFlag (); 2132 #if NO_OUTPUT_OF_PRIOR_PICS2133 Bool getBlaPicFlag ();2134 Bool getCraPicFlag ();2135 #endif2136 2152 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2137 2153 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2138 2154 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2139 2155 #if NO_CLRAS_OUTPUT_FLAG 2156 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ); 2140 2157 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 2141 2158 #else … … 2163 2180 #if SVC_EXTENSION 2164 2181 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 2182 #if Q0048_CGS_3D_ASYMLUT 2183 Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } 2184 Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } 2185 #endif 2165 2186 #else 2166 2187 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); … … 2203 2224 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 2204 2225 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); 2226 #if ALLOW_RECOVERY_POINT_AS_RAP 2227 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2228 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2229 #else 2230 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2231 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2232 #endif 2207 2233 2208 2234 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } 2209 2235 UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } 2236 2237 #if SETTING_NO_OUT_PIC_PRIOR 2238 Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } 2239 Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } 2240 2241 Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } 2242 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } 2243 2244 Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } 2245 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } 2246 #endif 2210 2247 2211 2248 Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } … … 2360 2397 2361 2398 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 2399 #if POC_RESET_IDC_SIGNALLING 2374 2400 Int getPocResetIdc () { return m_pocResetIdc; } … … 2388 2414 #endif 2389 2415 2416 #if NO_OUTPUT_OF_PRIOR_PICS 2417 Bool getBlaPicFlag (); 2418 Bool getCraPicFlag (); 2419 #endif 2420 2390 2421 #endif //SVC_EXTENSION 2391 2422 protected: -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r644 r713 99 99 #if O0215_PHASE_ALIGNMENT 100 100 #if O0194_JOINT_US_BITSHIFT 101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )102 #else 103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ) 102 #else 103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ) 104 104 #endif 105 105 #else … … 116 116 Int i, j; 117 117 118 #if O0194_JOINT_US_BITSHIFT 119 UInt currLayerId = currSlice->getLayerId(); 120 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc ); 121 #endif 122 123 #if O0098_SCALED_REF_LAYER_ID 124 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 125 #else 126 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 127 #endif 128 118 129 //========== Y component upsampling =========== 119 const Window &scalEL = window;120 121 130 Int widthBL = pcBasePic->getWidth (); 122 131 Int heightBL = pcBasePic->getHeight(); … … 127 136 Int strideEL = pcUsPic->getStride(); 128 137 138 #if Q0200_CONFORMANCE_BL_SIZE 139 Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 140 const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 141 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 142 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 143 #endif 129 144 #if P0312_VERT_PHASE_ADJ 130 145 Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag(); … … 159 174 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 160 175 161 #if O0194_JOINT_US_BITSHIFT162 UInt currLayerId = currSlice->getLayerId();163 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );164 #endif165 166 176 // non-normative software optimization for certain simple resampling cases 167 177 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x … … 172 182 #if O0194_JOINT_US_BITSHIFT 173 183 Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId]; 184 #if Q0048_CGS_3D_ASYMLUT 185 if( currSlice->getPPS()->getCGSFlag() ) 186 { 187 shift = g_bitDepthYLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthY(); 188 } 189 assert( shift >= 0 ); 190 #endif 174 191 #endif 175 192 … … 205 222 #if O0194_JOINT_US_BITSHIFT 206 223 shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId]; 224 #if Q0048_CGS_3D_ASYMLUT 225 if( currSlice->getPPS()->getCGSFlag() ) 226 { 227 shift = g_bitDepthCLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthC(); 228 } 229 #endif 207 230 #endif 208 231 … … 254 277 Int phaseX = 2*phaseAlignFlag; 255 278 #if P0312_VERT_PHASE_ADJ 279 #if Q0120_PHASE_CALCULATION 280 Int phaseY = 2*phaseAlignFlag; 281 #else 256 282 Int phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag ); 283 #endif 257 284 #else 258 285 Int phaseY = 2*phaseAlignFlag; … … 261 288 Int phaseX = 0; 262 289 #if P0312_VERT_PHASE_ADJ 290 #if Q0120_PHASE_CALCULATION 291 Int phaseY = 0; 292 #else 263 293 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0)); 294 #endif 264 295 #else 265 296 Int phaseY = 0; 266 297 #endif 267 298 #endif 268 299 269 300 #if ROUNDING_OFFSET 270 301 Int addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 271 302 Int addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 272 303 #else 273 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 274 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 275 #endif 276 277 Int deltaX = 4 * phaseX; 278 Int deltaY = 4 * phaseY; 304 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 305 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 306 #endif 307 308 #if Q0120_PHASE_CALCULATION 309 Int deltaX = (Int)phaseAlignFlag <<3; 310 Int deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3); 311 #else 312 Int deltaX = 4 * phaseX; 313 Int deltaY = 4 * phaseY; 314 #endif 315 316 #if Q0200_CONFORMANCE_BL_SIZE 317 deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4; 318 deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4; 319 #endif 279 320 280 321 Int shiftXM4 = shiftX - 4; 281 322 Int shiftYM4 = shiftY - 4; 282 323 283 widthEL 284 heightEL 285 286 widthBL 287 heightBL 324 widthEL = pcUsPic->getWidth (); 325 heightEL = pcUsPic->getHeight(); 326 327 widthBL = pcBasePic->getWidth (); 328 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 288 329 289 330 Int leftStartL = scalEL.getWindowLeftOffset(); … … 292 333 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 293 334 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 294 295 335 #if N0214_INTERMEDIATE_BUFFER_16BITS 296 336 #if O0194_JOINT_US_BITSHIFT 297 337 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 298 338 Int shift1 = g_bitDepthYLayer[refLayerId] - 8; 339 #if Q0048_CGS_3D_ASYMLUT 340 if( currSlice->getPPS()->getCGSFlag() ) 341 { 342 shift1 = currSlice->getPPS()->getCGSOutputBitDepthY() - 8; 343 } 344 #endif 299 345 #else 300 346 Int shift1 = g_bitDepthY - 8; … … 380 426 widthBL = pcBasePic->getWidth (); 381 427 heightBL = pcBasePic->getHeight(); 382 383 428 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 384 429 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 400 445 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 401 446 leftOffset = leftStartC > 0 ? leftStartC : 0; 402 403 447 shiftX = 16; 404 448 shiftY = 16; … … 407 451 Int phaseXC = phaseAlignFlag; 408 452 #if P0312_VERT_PHASE_ADJ 453 #if Q0120_PHASE_CALCULATION 454 Int phaseYC = phaseAlignFlag + 1; 455 #else 409 456 Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 ); 457 #endif 410 458 #else 411 459 Int phaseYC = phaseAlignFlag + 1; … … 414 462 Int phaseXC = 0; 415 463 #if P0312_VERT_PHASE_ADJ 464 #if Q0120_PHASE_CALCULATION 465 Int phaseYC = 1; 466 #else 416 467 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1; 468 #endif 417 469 #else 418 470 Int phaseYC = 1; … … 428 480 #endif 429 481 482 #if Q0120_PHASE_CALCULATION 483 deltaX = (Int)phaseAlignFlag << 2; 484 deltaY = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3); 485 #else 430 486 deltaX = 4 * phaseXC; 431 487 deltaY = 4 * phaseYC; 488 #endif 489 490 #if Q0200_CONFORMANCE_BL_SIZE 491 deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4; 492 deltaY -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4; 493 #endif 432 494 433 495 shiftXM4 = shiftX - 4; … … 444 506 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 445 507 shift1 = g_bitDepthCLayer[refLayerId] - 8; 508 #if Q0048_CGS_3D_ASYMLUT 509 if( currSlice->getPPS()->getCGSFlag() ) 510 { 511 shift1 = currSlice->getPPS()->getCGSOutputBitDepthC() - 8; 512 } 513 #endif 446 514 #else 447 515 shift1 = g_bitDepthC - 8; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r644 r713 45 45 #if O0215_PHASE_ALIGNMENT 46 46 #if O0194_JOINT_US_BITSHIFT 47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag );47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ); 48 48 #else 49 49 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r644 r713 42 42 43 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 45 44 #if SVC_EXTENSION 46 45 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle … … 50 49 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 51 50 51 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 52 52 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 53 #if P0312_VERT_PHASE_ADJ 54 #define Q0120_PHASE_CALCULATION 1 ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding. 55 #endif 53 56 #define P0130_EOB 1 ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0 54 57 #define P0307_REMOVE_VPS_VUI_OFFSET 1 ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling … … 81 84 82 85 #define O0164_MULTI_LAYER_HRD 1 ///< JCTVC-O0164: Multi-layer HRD operation 86 #define Q0074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping 83 87 84 88 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) … … 86 90 #define O0194_JOINT_US_BITSHIFT 1 ///< JCTVC-O0194: Joint Upsampling and bit-shift 87 91 #endif 92 #define Q0048_CGS_3D_ASYMLUT 1 ///< JCTVC-Q0048: Colour gamut scalability with look-up table 93 #if Q0048_CGS_3D_ASYMLUT 94 #define O0194_WEIGHTED_PREDICTION_CGS 0 95 #else 88 96 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 97 #endif 89 98 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 90 99 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 … … 185 194 #define TSLAYERS_IL_RPS 1 ///< JCTVC-O0120 IL RPS based on max temporal sub-layers 186 195 #define P0079_DERIVE_NUMACTIVE_REF_PICS 1 ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics 196 #define Q0060_MAX_TID_REF_EQUAL_TO_ZERO 1 ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0. 187 197 #if REF_IDX_MFM 188 198 #define N0139_POSITION_ROUNDING_OFFSET 1 ///< JCTVC-N0139: offset for collocated block in motion mapping … … 226 236 #define O0096_DEFAULT_DEPENDENCY_TYPE 1 ///< JCTVC-O0096: specify default dependency type for all direct reference layers 227 237 238 #define Q0195_REP_FORMAT_CLEANUP 1 ///< JCTVC-Q0195: restructureing of rep_format() signaling 239 #define REP_FORMAT_FIX 1 ///< update_rep_format_flag should be inferred to be equal to 0 240 228 241 #define RESAMPLING_CONSTRAINT_BUG_FIX 1 229 242 #define O0098_SCALED_REF_LAYER_ID 1 ///< JCTVC-O0098: signal scaled reference id … … 231 244 #define O0153_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-O0153: alt output layer flag 232 245 #define P0300_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-P0300: alt output layer flag 246 247 #define Q0165_OUTPUT_LAYER_SET 1 ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set 248 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 233 249 234 250 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters … … 264 280 //! \ingroup TLibCommon 265 281 //! \{ 282 #define HARMONIZE_GOP_FIRST_FIELD_COUPLE 1 283 #define FIX_FIELD_DEPTH 1 284 #define EFFICIENT_FIELD_IRAP 1 285 #define ALLOW_RECOVERY_POINT_AS_RAP 1 266 286 #define BUGFIX_INTRAPERIOD 1 267 287 #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1 268 288 289 #define SAO_SGN_FUNC 1 290 269 291 #define FIX1172 1 ///< fix ticket #1172 292 293 #define SETTING_PIC_OUTPUT_MARK 1 294 #define SETTING_NO_OUT_PIC_PRIOR 1 295 #define FIX_EMPTY_PAYLOAD_NAL 1 296 #define FIX_WRITING_OUTPUT 1 297 #define FIX_OUTPUT_EOS 1 298 299 #define FIX_POC_CRA_NORASL_OUTPUT 1 270 300 271 301 #define MAX_NUM_PICS_IN_SOP 1024
Note: See TracChangeset for help on using the changeset viewer.