Changeset 368 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
- Timestamp:
- 3 May 2013, 17:16:12 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
r367 r368 42 42 #include "TLibCommon/ContextModel.h" 43 43 #endif 44 #if H_MV 45 #include "../../App/TAppEncoder/TAppEncTop.h" 46 #endif 44 47 45 48 //! \ingroup TLibEncoder … … 78 81 m_pcBitCounters = NULL; 79 82 m_pcRdCosts = NULL; 83 #if H_MV 84 m_ivPicLists = NULL; 85 #endif 80 86 } 81 87 … … 89 95 Void TEncTop::create () 90 96 { 97 #if !H_MV 91 98 // initialize global variables 92 99 initROM(); 100 #endif 93 101 94 102 // create processing unit classes … … 268 276 delete[] m_pcRdCosts; 269 277 278 #if !H_MV 270 279 // destroy ROM 271 280 destroyROM(); 281 #endif 272 282 273 283 return; … … 319 329 // ==================================================================================================================== 320 330 331 #if H_MV 332 Void TEncTop::initNewPic( TComPicYuv* pcPicYuvOrg ) 333 { 334 TComPic* pcPicCurr = NULL; 335 336 // get original YUV 337 xGetNewPicBuffer( pcPicCurr ); 338 pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() ); 339 340 // compute image characteristics 341 if ( getUseAdaptiveQP() ) 342 { 343 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) ); 344 } 345 } 346 #endif 321 347 Void TEncTop::deletePicBuffer() 322 348 { … … 345 371 \retval iNumEncoded number of encoded pictures 346 372 */ 373 #if H_MV 374 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId ) 375 { 376 #else 347 377 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ) 348 378 { 379 #endif 380 #if H_3D 381 TComPic* picLastCoded = getPic( getGOPEncoder()->getPocLastCoded() ); 382 if( picLastCoded ) 383 { 384 picLastCoded->compressMotion(); 385 } 386 #endif 387 #if H_MV 388 if( gopId == 0) 389 { 390 m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 391 #else 349 392 if (pcPicYuvOrg) { 350 393 // get original YUV … … 365 408 return; 366 409 } 410 #endif 367 411 368 412 #if RATE_CONTROL_LAMBDA_DOMAIN … … 373 417 #endif 374 418 419 #if H_MV 420 } 421 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId ); 422 423 if( gopId + 1 == m_cGOPEncoder.getGOPSize() ) 424 { 425 #else 375 426 // compress GOP 376 427 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 428 #endif 377 429 378 430 #if RATE_CONTROL_LAMBDA_DOMAIN … … 386 438 m_iNumPicRcvd = 0; 387 439 m_uiNumAllPicCoded += iNumEncoded; 440 #if H_MV 441 } 442 #endif 388 443 } 389 444 … … 450 505 Void TEncTop::xInitSPS() 451 506 { 507 #if H_MV 508 m_cSPS.setSPSId( getLayerIdInVps() ); 509 #endif 452 510 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 453 511 profileTierLevel.setLevelIdc(m_level); … … 594 652 Void TEncTop::xInitPPS() 595 653 { 654 #if H_MV 655 if( m_cVPS.getNumDirectRefLayers( getLayerIdInVps() ) > 0 ) 656 { 657 m_cPPS.setListsModificationPresentFlag( true ); 658 } 659 m_cPPS.setPPSId( getLayerIdInVps() ); 660 m_cPPS.setSPSId( getLayerIdInVps() ); 661 #endif 596 662 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 597 663 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; … … 897 963 Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ) 898 964 { 965 #if H_MV 966 if( slice->getRapPicFlag() == true && getLayerId() > 0 && POCCurr == 0 ) 967 { 968 TComReferencePictureSet* rps = slice->getLocalRPS(); 969 rps->setNumberOfNegativePictures(0); 970 rps->setNumberOfPositivePictures(0); 971 rps->setNumberOfLongtermPictures(0); 972 rps->setNumberOfPictures(0); 973 slice->setRPS(rps); 974 } 975 else 976 { 977 #endif 899 978 slice->setRPSidx(GOPid); 900 979 … … 924 1003 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 925 1004 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); 1005 #if H_MV 1006 } 1007 #endif 926 1008 927 1009 } … … 1038 1120 } 1039 1121 } 1122 #if H_MV 1123 Void TEncTop::printSummary( Int numAllPicCoded ) 1124 { 1125 assert (numAllPicCoded == m_cAnalyzeAll.getNumPic()); 1126 1127 //--CFG_KDY 1128 m_cAnalyzeAll.setFrmRate( getFrameRate() ); 1129 m_cAnalyzeI.setFrmRate( getFrameRate() ); 1130 m_cAnalyzeP.setFrmRate( getFrameRate() ); 1131 m_cAnalyzeB.setFrmRate( getFrameRate() ); 1132 1133 //-- all 1134 printf( "\n\nSUMMARY ------------------------------------------- LayerId %2d\n", m_layerId ); 1135 1136 m_cAnalyzeAll.printOut('a'); 1137 1138 printf( "\n\nI Slices--------------------------------------------------------\n" ); 1139 m_cAnalyzeI.printOut('i'); 1140 1141 printf( "\n\nP Slices--------------------------------------------------------\n" ); 1142 m_cAnalyzeP.printOut('p'); 1143 1144 printf( "\n\nB Slices--------------------------------------------------------\n" ); 1145 m_cAnalyzeB.printOut('b'); 1146 1147 #if _SUMMARY_OUT_ 1148 m_cAnalyzeAll.printSummaryOut(); 1149 #endif 1150 #if _SUMMARY_PIC_ 1151 m_cAnalyzeI.printSummary('I'); 1152 m_cAnalyzeP.printSummary('P'); 1153 m_cAnalyzeB.printSummary('B'); 1154 #endif 1155 } 1156 1157 Int TEncTop::getFrameId(Int iGOPid) 1158 { 1159 if(m_iPOCLast == 0) 1160 { 1161 return(0 ); 1162 } 1163 else 1164 { 1165 return m_iPOCLast -m_iNumPicRcvd+ getGOPEntry(iGOPid).m_POC ; 1166 } 1167 } 1168 1169 TComPic* TEncTop::getPic( Int poc ) 1170 { 1171 TComList<TComPic*>* listPic = getListPic(); 1172 TComPic* pcPic = NULL; 1173 for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++) 1174 { 1175 if( (*it)->getPOC() == poc ) 1176 { 1177 pcPic = *it ; 1178 break ; 1179 } 1180 } 1181 return pcPic; 1182 } 1183 #endif 1040 1184 //! \}
Note: See TracChangeset for help on using the changeset viewer.