Changeset 456 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp
- Timestamp:
- 4 Jun 2013, 18:05:33 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp
r455 r456 558 558 #endif // H_3D 559 559 #endif // H_MV 560 560 561 #if H_3D_NBDV 561 Int TComPic::getDisCandRefPictures(Int iColPOC) 562 { 563 UInt uiTempLayerCurr=7; 564 TComSlice* currSlice = getSlice(getCurrSliceIdx()); 565 UInt NumDdvCandPics = 0; 562 Int TComPic::getDisCandRefPictures( Int iColPOC ) 563 { 564 UInt uiTempLayerCurr = 7; 565 TComSlice* currSlice = getSlice(getCurrSliceIdx()); 566 UInt numDdvCandPics = 0; 567 566 568 if ( !currSlice->getEnableTMVPFlag() ) 567 return NumDdvCandPics;568 NumDdvCandPics +=1; 569 570 UInt iPOCCurr=currSlice->getPOC(); 571 UInt iPOCDiff = 255;572 Bool bCheck = false;569 return numDdvCandPics; 570 571 numDdvCandPics += 1; 572 573 UInt pocCurr = currSlice->getPOC(); 574 UInt pocDiff = 255; 573 575 574 576 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++) 575 577 { 576 UInt X = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();577 for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(X)); i++) 578 {579 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)X, i)->getViewIndex()580 && (X == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)X, i)!= iColPOC) && NumDdvCandPics!=2)581 {582 TComSlice* refSlice = currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx());583 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0;584 UInt uiTempLayer = currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx())->getTLayer();585 Int iTempPoc = currSlice->getRefPic((RefPicList)X, i)->getPOC();586 Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);587 if( bRAP)578 UInt x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); 579 580 for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 581 { 582 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() 583 && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2) 584 { 585 TComSlice* refSlice = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx()); 586 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0; 587 UInt uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer(); 588 589 if( bRAP ) 588 590 { 589 591 this->setRapRefIdx(i); 590 this->setRapRefList((RefPicList)X); 591 NumDdvCandPics = 2; 592 return NumDdvCandPics; 592 this->setRapRefList((RefPicList)x); 593 numDdvCandPics = 2; 594 595 return numDdvCandPics; 593 596 } 594 597 else if (uiTempLayerCurr > uiTempLayer) 598 { 595 599 uiTempLayerCurr = uiTempLayer; 596 } 597 } 598 } 599 UInt Z; 600 UInt idx=0; 600 } 601 } 602 } 603 } 604 605 UInt z = -1; // GT: Added to make code compile needs to be checked! 606 UInt idx = 0; 607 601 608 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++) 602 609 { 603 UInt X = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag(); 604 for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(X)); i++) 605 { 606 Int iTempPoc = currSlice->getRefPic((RefPicList)X, i)->getPOC(); 607 Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc); 608 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)X, i)->getViewIndex() && (X == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)X, i)!= iColPOC) 609 && currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && iPOCDiff > iTempDiff) 610 { 611 iPOCDiff=iTempDiff; 612 Z=X; 613 idx = i; 614 } 615 } 616 } 617 if(iPOCDiff<255) 610 UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag(); 611 612 for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 613 { 614 Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC(); 615 Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr): (pocCurr - iTempPoc); 616 617 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) 618 && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff) 619 { 620 pocDiff = iTempDiff; 621 z = x; 622 idx = i; 623 } 624 } 625 } 626 627 if( pocDiff < 255 ) 618 628 { 619 629 this->setRapRefIdx(idx); 620 this->setRapRefList((RefPicList) Z);621 NumDdvCandPics = 2;622 } 623 624 return NumDdvCandPics;630 this->setRapRefList((RefPicList) z ); 631 numDdvCandPics = 2; 632 } 633 634 return numDdvCandPics; 625 635 } 626 636 #endif
Note: See TracChangeset for help on using the changeset viewer.