Changeset 294 in 3DVCSoftware for branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
- Timestamp:
- 19 Feb 2013, 20:33:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r292 r294 107 107 108 108 m_bEncodeDQP = false; 109 #if BURST_IPCM110 109 m_checkBurstIPCMFlag = false; 111 #endif112 110 113 111 // initialize partition order. … … 285 283 } 286 284 287 #if BURST_IPCM288 285 TComPic* pcPic = pcCU->getPic(); 289 286 Bool checkBurstIPCMFlag = (pcPic->getSlice(0)->getSPS()->getUsePCM())? true : false; … … 293 290 pcCU->setNumSucIPCM(0); 294 291 pcCU->setLastCUSucIPCMFlag(false); 295 #endif296 292 297 293 // Encode CU data 298 294 xEncodeCU( pcCU, 0, 0 ); 299 295 300 #if OL_FLUSH301 296 bool bTerminateSlice = bForceTerminate; 302 297 UInt uiCUAddr = pcCU->getAddr(); 303 298 /* If at the end of an LCU line but not at the end of a substream, perform CABAC flush */ 304 #if WPP_SIMPLIFICATION305 299 if (!bTerminateSlice && pcCU->getSlice()->getPPS()->getNumSubstreams() > 1) 306 #else307 if (!bTerminateSlice && pcCU->getSlice()->getPPS()->getCabacIstateReset())308 #endif309 300 { 310 301 Int iNumSubstreams = pcCU->getSlice()->getPPS()->getNumSubstreams(); … … 312 303 UInt uiCol = uiCUAddr % uiWidthInLCUs; 313 304 UInt uiLin = uiCUAddr / uiWidthInLCUs; 314 #if !REMOVE_TILE_DEPENDENCE315 Int iBreakDep = pcCU->getPic()->getPicSym()->getTileBoundaryIndependenceIdr();316 #endif317 305 UInt uiTileStartLCU = pcCU->getPic()->getPicSym()->getTComTile(pcCU->getPic()->getPicSym()->getTileIdxMap(uiCUAddr))->getFirstCUAddr(); 318 306 UInt uiTileLCUX = uiTileStartLCU % uiWidthInLCUs; … … 321 309 UInt uiTileHeight = pcCU->getPic()->getPicSym()->getTComTile(pcCU->getPic()->getPicSym()->getTileIdxMap(uiCUAddr))->getTileHeight(); 322 310 Int iNumSubstreamsPerTile = iNumSubstreams; 323 #if !REMOVE_TILE_DEPENDENCE 324 #if WPP_SIMPLIFICATION 325 if (iBreakDep && pcCU->getSlice()->getPPS()->getNumSubstreams() > 1) 326 #else 327 if (iBreakDep && pcCU->getSlice()->getPPS()->getEntropyCodingSynchro()) 328 #endif 311 if (pcCU->getSlice()->getPPS()->getNumSubstreams() > 1) 312 { 329 313 iNumSubstreamsPerTile /= pcCU->getPic()->getPicSym()->getNumTiles(); 330 if ((iBreakDep && (uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))331 || (!iBreakDep && (uiCol == uiWidthInLCUs-1) && (uiLin+iNumSubstreams < pcCU->getPic()->getFrameHeightInCU())))314 } 315 if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 332 316 { 333 317 m_pcEntropyCoder->encodeFlush(); 334 318 } 335 #else 336 #if WPP_SIMPLIFICATION 337 if (pcCU->getSlice()->getPPS()->getNumSubstreams() > 1) 338 #else 339 if (pcCU->getSlice()->getPPS()->getEntropyCodingSynchro()) 340 #endif 341 { 342 iNumSubstreamsPerTile /= pcCU->getPic()->getPicSym()->getNumTiles(); 343 } 344 if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 345 { 346 m_pcEntropyCoder->encodeFlush(); 347 } 348 #endif 349 } 350 #endif // OL_FLUSH 319 } 351 320 } 352 321 … … 556 525 #if LOSSLESS_CODING 557 526 Bool isAddLowestQP = false; 558 #if H0736_AVC_STYLE_QP_RANGE559 527 Int lowestQP = -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(); 560 #else561 Int lowestQP = 0;562 #endif563 528 #endif 564 529 … … 566 531 { 567 532 Int idQP = m_pcEncCfg->getMaxDeltaQP(); 568 #if H0736_AVC_STYLE_QP_RANGE569 533 iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 570 534 iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); … … 576 540 577 541 } 578 #endif579 #else580 iMinQP = Clip3( MIN_QP, MAX_QP, iBaseQP-idQP );581 iMaxQP = Clip3( MIN_QP, MAX_QP, iBaseQP+idQP );582 #if LOSSLESS_CODING583 if ( (rpcTempCU->getSlice()->getSPS()->getUseLossless()) && (lowestQP < iMinQP) && rpcTempCU->getSlice()->getPPS()->getUseDQP() )584 {585 isAddLowestQP = true;586 iMinQP = iMinQP - 1;587 }588 #endif589 542 #endif 590 543 } … … 1317 1270 { 1318 1271 Int idQP = m_pcEncCfg->getMaxDeltaQP(); 1319 #if H0736_AVC_STYLE_QP_RANGE1320 1272 iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP-idQP ); 1321 1273 iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQP+idQP ); … … 1326 1278 iMinQP = iMinQP - 1; 1327 1279 } 1328 #endif1329 #else1330 iMinQP = Clip3( MIN_QP, MAX_QP, iBaseQP-idQP );1331 iMaxQP = Clip3( MIN_QP, MAX_QP, iBaseQP+idQP );1332 #if LOSSLESS_CODING1333 if ( (rpcTempCU->getSlice()->getSPS()->getUseLossless()) && (lowestQP < iMinQP) && rpcTempCU->getSlice()->getPPS()->getUseDQP() )1334 {1335 isAddLowestQP = true;1336 iMinQP = iMinQP - 1;1337 }1338 #endif1339 1280 #endif 1340 1281 } … … 1635 1576 &&((uiPosY+pcCU->getHeight(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosY+pcCU->getHeight(uiAbsPartIdx)==uiHeight)); 1636 1577 1637 #if BURST_IPCM1638 1578 if(granularityBoundary && (!(pcCU->getIPCMFlag(uiAbsPartIdx) && ( pcCU->getNumSucIPCM() > 1 )))) 1639 #else1640 if(granularityBoundary)1641 #endif1642 1579 { 1643 1580 // The 1-terminating bit is added to all streams, so don't add it here when it's 1. … … 1731 1668 iQpOffset = Int(floor( dQpOffset + 0.49999 )); 1732 1669 } 1733 #if H0736_AVC_STYLE_QP_RANGE1734 1670 return Clip3(-pcCU->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, iBaseQp+iQpOffset ); 1735 #else1736 return Clip3( MIN_QP, MAX_QP, iBaseQp+iQpOffset );1737 #endif1738 1671 } 1739 1672 … … 1754 1687 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 1755 1688 1756 #if BURST_IPCM1757 1689 if( getCheckBurstIPCMFlag() ) 1758 1690 { … … 1760 1692 pcCU->setNumSucIPCM( countNumSucIPCM ( pcCU, uiAbsPartIdx ) ); 1761 1693 } 1762 #endif1763 1694 1764 1695 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); … … 1833 1764 setdQPFlag(true); 1834 1765 } 1835 #if BURST_IPCM1836 1766 pcCU->setNumSucIPCM(0); 1837 1767 pcCU->setLastCUSucIPCMFlag(false); 1838 #endif1839 1768 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++, uiAbsPartIdx+=uiQNumParts ) 1840 1769 { … … 1991 1920 #endif 1992 1921 1993 #if FAST_DECISION_FOR_MRG_RD_COST1994 1922 Bool bestIsSkip = false; 1995 #endif1996 1923 1997 1924 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) … … 2023 1950 #endif 2024 1951 { 2025 #if FAST_DECISION_FOR_MRG_RD_COST2026 1952 if( !(bestIsSkip && uiNoResidual == 0) ) 2027 1953 { 2028 #endif2029 1954 // set MC parameters 2030 1955 rpcTempCU->setPredModeSubParts( MODE_SKIP, 0, uhDepth ); // interprets depth relative to LCU level … … 2088 2013 else 2089 2014 { 2090 #if FAST_DECISION_FOR_MRG_RD_COST2091 2015 if( bestIsSkip) 2092 2016 { … … 2107 2031 else 2108 2032 { 2109 #endif2110 2033 if ( pcPredYuvTemp != m_ppcPredYuvTemp[uhDepth]) 2111 2034 { … … 2113 2036 pcPredYuvTemp = m_ppcPredYuvBest[uhDepth]; 2114 2037 } 2115 #if FAST_DECISION_FOR_MRG_RD_COST2116 2038 } 2117 #endif2118 2039 } 2119 2040 #if HHI_VSO … … 2140 2061 Bool bQtRootCbf = rpcTempCU->getQtRootCbf(0) == 1; 2141 2062 2142 #if H0736_AVC_STYLE_QP_RANGE2143 2063 Int orgQP = rpcTempCU->getQP( 0 ); 2144 2064 xCheckDQP( rpcTempCU ); 2145 2065 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2146 2066 rpcTempCU->initEstData( uhDepth, orgQP ); 2147 #else 2148 UInt uiOrgQP = rpcTempCU->getQP( 0 ); 2149 xCheckDQP( rpcTempCU ); 2150 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2151 rpcTempCU->initEstData( uhDepth, uiOrgQP ); 2152 #endif 2153 2154 #if FAST_DECISION_FOR_MRG_RD_COST 2067 2155 2068 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 2156 2069 { 2157 2070 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 2158 2071 } 2159 #endif2160 2072 2161 2073 if (!bQtRootCbf) 2162 2074 break; 2163 #if FAST_DECISION_FOR_MRG_RD_COST2164 2075 } 2165 #endif2166 2076 } 2167 2077 } … … 2515 2425 } 2516 2426 2517 #if BURST_IPCM2518 2427 /** Check whether the last CU shares the same root as the current CU and is IPCM or not. 2519 2428 * \param pcCU … … 2607 2516 return numSucIPCM; 2608 2517 } 2609 #endif2610 2518 2611 2519 Void TEncCu::xCopyAMVPInfo (AMVPInfo* pSrc, AMVPInfo* pDst)
Note: See TracChangeset for help on using the changeset viewer.