Changeset 25 in SHVCSoftware for branches/SHM-1.0-dev/source/Lib/TLibEncoder
- Timestamp:
- 4 Feb 2013, 08:30:23 (12 years ago)
- Location:
- branches/SHM-1.0-dev/source/Lib/TLibEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r2 r25 600 600 #endif 601 601 WRITE_FLAG( pcSPS->getTMVPFlagsPresent() ? 1 : 0, "sps_temporal_mvp_enable_flag" ); 602 #if REF_IDX_MFM 603 if( pcSPS->getLayerId() > 0 ) 604 { 605 assert(pcSPS->getMFMEnabledFlag()); 606 WRITE_FLAG( pcSPS->getMFMEnabledFlag() ? 1 : 0, "sps_enh_mfm_enable_flag" ); 607 } 608 #endif 602 609 #if SUPPORT_FOR_VUI 603 610 WRITE_FLAG( pcSPS->getVuiParametersPresentFlag(), "vui_parameters_present_flag" ); -
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r2 r25 465 465 #endif 466 466 467 #if REF_IDX_FRAMEWORK 468 if (pcSlice->getSliceType() == B_SLICE) 469 pcSlice->setColFromL0Flag(1-uiColDir); 470 #endif 471 467 472 // Set reference list 468 473 pcSlice->setRefPicList ( rcListPic ); … … 471 476 { 472 477 m_pcEncTop->setILRPic(pcPic); 478 479 #if REF_IDX_MFM 480 pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic()); 481 #endif 473 482 pcSlice->addRefPicList ( m_pcEncTop->getIlpList(), 1); 483 484 #if REF_IDX_MFM 485 Bool found = false; 486 UInt ColFromL0Flag = pcSlice->getColFromL0Flag(); 487 UInt ColRefIdx = pcSlice->getColRefIdx(); 488 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 489 { 490 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getIsILR() ) 491 { 492 ColRefIdx = colIdx; 493 found = true; 494 break; 495 } 496 } 497 498 if( found == false ) 499 { 500 ColFromL0Flag = 1 - ColFromL0Flag; 501 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 502 { 503 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getIsILR() ) 504 { 505 ColRefIdx = colIdx; 506 found = true; 507 break; 508 } 509 } 510 } 511 512 if(found == true) 513 { 514 pcSlice->setColFromL0Flag(ColFromL0Flag); 515 pcSlice->setColRefIdx(ColRefIdx); 516 } 517 #endif 474 518 } 475 519 #endif … … 495 539 if (pcSlice->getSliceType() == B_SLICE) 496 540 { 541 #if !REF_IDX_FRAMEWORK 497 542 pcSlice->setColFromL0Flag(1-uiColDir); 543 #endif 498 544 Bool bLowDelay = true; 499 545 Int iCurrPOC = pcSlice->getPOC(); … … 1515 1561 1516 1562 pcPic->compressMotion(); 1563 #if REF_IDX_MFM 1564 if( m_layerId == 0 && pcPic->upsampledMvFieldIsNull() ) 1565 { 1566 Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight(); 1567 Int iEWidth = m_ppcTEncTop[m_layerId+1]->getSourceWidth(); 1568 pcPic->createUpSampledMvField(iEHeight, iEWidth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); //create up-sampled mv field 1569 } 1570 1571 if( m_layerId == 0 && pcPic->IsUpsampledMvField() == false ) 1572 { 1573 Int iBWidth = m_ppcTEncTop[m_layerId]->getSourceWidth() - m_ppcTEncTop[m_layerId]->getCropLeft() - m_ppcTEncTop[m_layerId]->getCropRight(); 1574 Int iBHeight = m_ppcTEncTop[m_layerId]->getSourceHeight() - m_ppcTEncTop[m_layerId]->getCropTop() - m_ppcTEncTop[m_layerId]->getCropBottom(); 1575 1576 Int iEWidth = m_ppcTEncTop[m_layerId+1]->getSourceWidth() - m_ppcTEncTop[m_layerId+1]->getCropLeft() - m_ppcTEncTop[m_layerId+1]->getCropRight(); 1577 Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight() - m_ppcTEncTop[m_layerId+1]->getCropTop() - m_ppcTEncTop[m_layerId+1]->getCropBottom(); 1578 1579 UInt upSampleRatio; 1580 if(iEWidth == iBWidth && iEHeight == iBHeight) 1581 upSampleRatio = 0; 1582 else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight) 1583 upSampleRatio = 1; 1584 else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight) 1585 upSampleRatio = 2; 1586 else 1587 assert(0); 1588 1589 pcPic->doTheUpSampleMvField(upSampleRatio); 1590 pcPic->setUpsampledMvField(true); 1591 } 1592 #endif 1517 1593 1518 1594 //-- For time output for each slice -
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r21 r25 85 85 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 86 86 #endif 87 #if REF_IDX_MFM 88 m_bMFMEnabledFlag = false; 89 #endif 87 90 } 88 91 … … 394 397 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 395 398 #endif 396 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE 399 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM 397 400 m_cIlpPic[j]->setIsILR(true); 398 401 #endif … … 599 602 // mark it should be extended 600 603 rpcPic->getPicYuvRec()->setBorderExtension(false); 604 #if REF_IDX_MFM 605 rpcPic->setUpsampledMvField(false); 606 #endif 601 607 } 602 608 … … 605 611 #if SVC_EXTENSION 606 612 m_cSPS.setLayerId(m_layerId); 613 #endif 614 #if REF_IDX_MFM 615 m_cSPS.setMFMEnabledFlag(m_bMFMEnabledFlag); 607 616 #endif 608 617 -
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.h
r2 r25 140 140 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 141 141 #endif 142 #if REF_IDX_MFM 143 Bool m_bMFMEnabledFlag; 144 #endif 142 145 protected: 143 146 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 228 231 Void setILRPic(TComPic *pcPic); 229 232 #endif 233 #if REF_IDX_MFM 234 Void setMFMEnabledFlag (Bool flag) {m_bMFMEnabledFlag = flag;} 235 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} 236 #endif 230 237 231 238 };
Note: See TracChangeset for help on using the changeset viewer.