Changeset 54 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCu.cpp
- Timestamp:
- 2 Mar 2013, 09:25:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCu.cpp
r51 r54 211 211 m_pcRdCost = pcEncTop->getRdCost(); 212 212 213 #if SVC_EXTENSION 214 m_ppcTEncTop = pcEncTop->getLayerEnc(); 215 for(UInt i=0 ; i< m_uhTotalDepth-1 ; i++) 216 { 217 m_ppcBestCU[i]->setLayerId(pcEncTop->getLayerId()); 218 m_ppcTempCU[i]->setLayerId(pcEncTop->getLayerId()); 219 } 220 #endif 221 213 222 m_pcEntropyCoder = pcEncTop->getEntropyCoder(); 214 223 m_pcCavlcCoder = pcEncTop->getCavlcCoder(); … … 445 454 if(!bSliceEnd && !bSliceStart && bInsidePicture ) 446 455 { 456 #if (ENCODER_FAST_MODE) 457 bool testInter = true; 458 if (rpcBestCU->getLayerId() > 0) 459 { 460 if (rpcBestCU->getSlice()->getBaseColPic()->getSlice(0)->getSliceType() == I_SLICE) 461 { 462 testInter = false; 463 } 464 465 } 466 #endif 447 467 for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++) 448 468 { … … 459 479 460 480 // do inter modes, SKIP and 2Nx2N 481 #if (ENCODER_FAST_MODE == 1) 482 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE && testInter ) 483 #else 461 484 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 485 #endif 462 486 { 463 487 // 2Nx2N … … 480 504 } 481 505 } 506 #if (ENCODER_FAST_MODE == 2) 507 if (testInter) 508 { 509 #endif 482 510 483 511 if(!m_pcEncCfg->getUseEarlySkipDetection()) … … 493 521 } 494 522 } 523 #if (ENCODER_FAST_MODE == 2) 524 } 525 #endif 526 495 527 } 496 528 … … 531 563 532 564 // do inter modes, NxN, 2NxN, and Nx2N 565 #if (ENCODER_FAST_MODE) 566 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE && testInter ) 567 #else 533 568 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 569 #endif 534 570 { 535 571 // 2Nx2N, NxN … … 685 721 { 686 722 // speedup for inter frames 723 #if (ENCODER_FAST_MODE) 724 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 725 !testInter || 726 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 727 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 728 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 729 #else 687 730 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 688 731 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 689 732 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 690 733 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 734 #endif 691 735 { 692 736 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); … … 716 760 } 717 761 } 762 #if INTRA_BL 763 if(m_pcPicYuvRecBase) 764 { 765 xCheckRDCostIntraBL( rpcBestCU, rpcTempCU ); 766 rpcTempCU->initEstData( uiDepth, iQP ); 767 } 768 #endif 769 770 #if (ENCODER_FAST_MODE) 771 if(pcPic->getLayerId() > 0) 772 { 773 xCheckRDCostILRUni( rpcBestCU, rpcTempCU); 774 rpcTempCU->initEstData( uiDepth, iQP ); 775 } 776 #endif 777 718 778 if (isAddLowestQP && (iQP == lowestQP)) 719 779 { … … 1150 1210 return; 1151 1211 } 1212 #if INTRA_BL 1213 m_pcEntropyCoder->encodeIntraBLFlag( pcCU, uiAbsPartIdx ); 1214 if ( !pcCU->isIntraBL( uiAbsPartIdx ) ) 1215 { 1216 #endif 1152 1217 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1153 1218 … … 1168 1233 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1169 1234 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1235 #if INTRA_BL 1236 } 1237 #endif 1170 1238 1171 1239 // Encode Coefficients … … 1221 1289 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 1222 1290 { 1223 { 1291 #if REF_IDX_ME_ZEROMV 1292 Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]); 1293 if(bZeroMVILR) 1294 { 1295 #endif 1224 1296 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1225 1297 { … … 1271 1343 } 1272 1344 } 1345 #if REF_IDX_ME_ZEROMV 1273 1346 } 1347 #endif 1274 1348 } 1275 1349 … … 1377 1451 1378 1452 m_pcEntropyCoder->resetBits(); 1453 #if INTRA_BL 1454 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true ); 1455 #endif 1379 1456 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 1380 1457 { … … 1430 1507 1431 1508 m_pcEntropyCoder->resetBits(); 1509 #if INTRA_BL 1510 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true ); 1511 #endif 1432 1512 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 1433 1513 { … … 1681 1761 } 1682 1762 #endif 1763 1764 #if INTRA_BL 1765 Void TEncCu::xCheckRDCostIntraBL( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU ) 1766 { 1767 UInt uiDepth = rpcTempCU->getDepth( 0 ); 1768 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 1769 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 1770 rpcTempCU->setPredModeSubParts( MODE_INTRA_BL, 0, uiDepth ); 1771 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uiDepth ); 1772 1773 m_pcPredSearch->setBaseRecPic( m_pcPicYuvRecBase ); 1774 #if NO_RESIDUAL_FLAG_FOR_BLPRED 1775 rpcTempCU->setDepthSubParts( uiDepth, 0 ); 1776 // rpcTempCU->setLumaIntraDirSubParts( DC_IDX, 0, uiDepth ); 1777 // rpcTempCU->setChromIntraDirSubParts( DC_IDX, 0, uiDepth ); 1778 m_ppcPredYuvTemp[uiDepth]->copyFromPicLuma ( rpcTempCU->getSlice()->getFullPelBaseRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, rpcTempCU->getWidth(0), rpcTempCU->getHeight(0)); 1779 m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 0); 1780 m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 1); 1781 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcResiYuvBest[uiDepth], m_ppcRecoYuvTemp[uiDepth], false ); 1782 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 1783 #else 1784 1785 m_pcPredSearch->estIntraBLPredQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth] ); 1786 1787 m_pcEntropyCoder->resetBits(); 1788 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true ); 1789 m_pcEntropyCoder->encodeSkipFlag( rpcTempCU, 0, true ); 1790 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 1791 { 1792 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 1793 } 1794 1795 // Encode Coefficients 1796 Bool bCodeDQP = getdQPFlag(); 1797 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 1798 setdQPFlag( bCodeDQP ); 1799 1800 if( m_bUseSBACRD ) m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 1801 1802 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 1803 if(m_pcEncCfg->getUseSBACRD()) 1804 { 1805 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 1806 } 1807 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 1808 #endif 1809 1810 xCheckDQP( rpcTempCU ); 1811 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 1812 } 1813 #endif 1814 1815 1816 1817 1683 1818 //! \}
Note: See TracChangeset for help on using the changeset viewer.