- Timestamp:
- 15 Nov 2013, 13:43:17 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/Lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r467 r474 1872 1872 #endif 1873 1873 1874 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1875 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 1876 { 1877 Bool checkILR = false; 1878 1879 if(uhInterDir&0x1) //list0 1880 { 1881 Int refIdxL0 = cMvFieldL0.getRefIdx(); 1882 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId); 1883 } 1884 if(uhInterDir&0x2) //list1 1885 { 1886 Int refIdxL1 = cMvFieldL1.getRefIdx(); 1887 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId); 1888 } 1889 1890 return checkILR; 1891 } 1892 #endif 1893 1874 1894 UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx ) 1875 1895 { -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.h
r442 r474 492 492 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 493 493 Bool isBipredRestriction( UInt puIdx ); 494 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 495 Bool isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); 496 #endif 494 497 495 498 // ------------------------------------------------------------------------------------------------------------------- -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCu.cpp
r442 r474 250 250 #endif 251 251 252 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 253 m_disableILP = xCheckTileSetConstraint(rpcCU); 254 m_pcPredSearch->setDisableILP(m_disableILP); 255 #endif 256 252 257 // analysis of CU 253 258 xCompressCU( m_ppcBestCU[0], m_ppcTempCU[0], 0 ); … … 261 266 } 262 267 } 268 #endif 269 270 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 271 xVerifyTileSetConstraint(rpcCU); 263 272 #endif 264 273 } … … 731 740 } 732 741 #if (ENCODER_FAST_MODE) 742 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 743 if(pcPic->getLayerId() > 0 && !m_disableILP) 744 #else 733 745 if(pcPic->getLayerId() > 0) 746 #endif 734 747 { 735 748 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) … … 1381 1394 Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 1382 1395 if(bZeroMVILR) 1396 { 1397 #endif 1398 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1399 if (!(rpcTempCU->isInterLayerReference(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]) && m_disableILP)) 1383 1400 { 1384 1401 #endif … … 1426 1443 } 1427 1444 } 1445 } 1446 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1447 } 1448 #endif 1428 1449 #if REF_IDX_ME_ZEROMV 1429 } 1430 #endif 1431 } 1450 } 1451 #endif 1432 1452 } 1433 1453 … … 1808 1828 } 1809 1829 1830 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1831 Bool TEncCu::xCheckTileSetConstraint( TComDataCU*& rpcCU ) 1832 { 1833 Bool disableILP = false; 1834 1835 if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0) 1836 { 1837 if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 2) 1838 { 1839 disableILP = true; 1840 } 1841 if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 1) 1842 { 1843 Int currCUaddr = rpcCU->getAddr(); 1844 Int frameWitdhInCU = rpcCU->getPic()->getPicSym()->getFrameWidthInCU(); 1845 Int frameHeightInCU = rpcCU->getPic()->getPicSym()->getFrameHeightInCU(); 1846 Bool leftCUExists = (currCUaddr % frameWitdhInCU) > 0; 1847 Bool aboveCUExists = (currCUaddr / frameWitdhInCU) > 0; 1848 Bool rightCUExists = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1); 1849 Bool belowCUExists = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1); 1850 Int currTileSetIdx = rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr); 1851 // Check if CU is at tile set boundary 1852 if ( (leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-1) != currTileSetIdx) || 1853 (leftCUExists && aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) || 1854 (aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) || 1855 (aboveCUExists && rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) || 1856 (rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+1) != currTileSetIdx) || 1857 (rightCUExists && belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) || 1858 (belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) || 1859 (belowCUExists && leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) ) 1860 { 1861 disableILP = true; // Disable ILP in tile set boundary CU 1862 } 1863 } 1864 } 1865 1866 return disableILP; 1867 } 1868 1869 Void TEncCu::xVerifyTileSetConstraint( TComDataCU*& rpcCU ) 1870 { 1871 if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0 && 1872 m_disableILP) 1873 { 1874 UInt numPartitions = rpcCU->getPic()->getNumPartInCU(); 1875 for (UInt i = 0; i < numPartitions; i++) 1876 { 1877 if (!rpcCU->isIntra(i)) 1878 { 1879 for (UInt refList = 0; refList < 2; refList++) 1880 { 1881 if (rpcCU->getInterDir(i) & (1<<refList)) 1882 { 1883 TComCUMvField *mvField = rpcCU->getCUMvField(RefPicList(refList)); 1884 if (mvField->getRefIdx(i) >= 0) 1885 { 1886 assert(!(rpcCU->getSlice()->getRefPic(RefPicList(refList), mvField->getRefIdx(i))->isILR(rpcCU->getLayerId()))); 1887 } 1888 } 1889 } 1890 } 1891 } 1892 } 1893 } 1894 #endif 1895 1810 1896 /** Collect ARL statistics from one LCU 1811 1897 * \param pcCU -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCu.h
r345 r474 108 108 Int m_temporalSAD; 109 109 #endif 110 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 111 Bool m_disableILP; 112 #endif 110 113 public: 111 114 /// copy parameters from encoder class … … 171 174 #endif 172 175 176 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 177 Bool xCheckTileSetConstraint( TComDataCU*& rpcCU ); 178 Void xVerifyTileSetConstraint( TComDataCU*& rpcCU ); 179 #endif 180 173 181 #if AMP_ENC_SPEEDUP 174 182 #if AMP_MRG -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r466 r474 3092 3092 { 3093 3093 #endif 3094 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3095 if (!(pcCU->isInterLayerReference(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]) && m_disableILP)) 3096 { 3097 #endif 3094 3098 UInt uiCostCand = MAX_UINT; 3095 3099 UInt uiBitsCand = 0; … … 3115 3119 uiMergeIndex = uiMergeCand; 3116 3120 } 3121 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3122 } 3123 #endif 3117 3124 #if REF_IDX_ME_ZEROMV 3118 3125 } … … 3221 3228 Int numValidMergeCand = 0 ; 3222 3229 3223 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI3224 Bool disableILP = false;3225 if (pcCU->getPic()->getLayerId() == (m_pcEncCfg->getNumLayer() - 1) && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && pcCU->getPic()->getPicSym()->getTileSetIdxMap(pcCU->getAddr()) >= 0)3226 {3227 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 2)3228 {3229 disableILP = true;3230 }3231 if (pcCU->getPic()->getPicSym()->getTileSetType(pcCU->getAddr()) == 1)3232 {3233 Int currCUaddr = pcCU->getAddr();3234 Int frameWitdhInCU = pcCU->getPic()->getPicSym()->getFrameWidthInCU();3235 Int frameHeightInCU = pcCU->getPic()->getPicSym()->getFrameHeightInCU();3236 Bool leftCUExists = (currCUaddr % frameWitdhInCU) > 0;3237 Bool aboveCUExists = (currCUaddr / frameWitdhInCU) > 0;3238 Bool rightCUExists = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1);3239 Bool belowCUExists = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1);3240 Int currTileSetIdx = pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr);3241 // Check if CU is at tile set boundary3242 if ( (leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-1) != currTileSetIdx) ||3243 (leftCUExists && aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) ||3244 (aboveCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) ||3245 (aboveCUExists && rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) ||3246 (rightCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+1) != currTileSetIdx) ||3247 (rightCUExists && belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) ||3248 (belowCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) ||3249 (belowCUExists && leftCUExists && pcCU->getPic()->getPicSym()->getTileIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) )3250 {3251 disableILP = true; // Disable ILP in tile set boundary CU3252 }3253 }3254 }3255 #endif3256 3257 3230 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 3258 3231 { … … 3305 3278 { 3306 3279 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3307 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && disableILP)3280 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && m_disableILP) 3308 3281 { 3309 3282 continue; … … 3529 3502 } 3530 3503 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3531 if (pcPic->isILR(pcCU->getLayerId()) && disableILP)3504 if (pcPic->isILR(pcCU->getLayerId()) && m_disableILP) 3532 3505 { 3533 3506 testIter = false; … … 3550 3523 } 3551 3524 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3552 if (pcPic->isILR(pcCU->getLayerId()) && disableILP)3525 if (pcPic->isILR(pcCU->getLayerId()) && m_disableILP) 3553 3526 { 3554 3527 testRefIdx = false; -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSearch.h
r345 r474 129 129 // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; 130 130 UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds 131 131 132 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 133 Bool m_disableILP; 134 #endif 135 132 136 public: 133 137 TEncSearch(); … … 220 224 Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); 221 225 Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); 226 227 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 228 Void setDisableILP(Bool a) {m_disableILP = a;} 229 #endif 230 222 231 protected: 223 232
Note: See TracChangeset for help on using the changeset viewer.