Changeset 1279 in 3DVCSoftware for branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp
- Timestamp:
- 15 Jul 2015, 14:57:32 (9 years ago)
- Location:
- branches/HTM-14.1-update-dev1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1
-
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp
r1200 r1279 75 75 m_apcPicYuv[i] = NULL; 76 76 } 77 #if H_3D_QTLPC77 #if NH_3D_QTLPC 78 78 m_bReduceBitsQTL = 0; 79 79 #endif 80 #if H_3D_NBDV80 #if NH_3D_NBDV 81 81 m_iNumDdvCandPics = 0; 82 82 m_eRapRefList = REF_PIC_LIST_0; … … 143 143 } 144 144 #if NH_3D 145 #if NH_3D_ARP 146 Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ) 147 { 148 Int iMaxCUWidth = (Int) ( getPicSym()->getSPS().getMaxCUWidth() ); 149 Int iMaxCuHeight = (Int) ( getPicSym()->getSPS().getMaxCUHeight() ); 150 151 UInt uiMaxTotalCUDepth = getPicSym()->getSPS().getMaxTotalCUDepth(); 152 Int iBaseUnitWidth = iMaxCUWidth >> uiMaxTotalCUDepth; 153 Int iBaseUnitHeight = iMaxCUWidth >> uiMaxTotalCUDepth; 154 155 Int iNumCuInWidth = getPicYuvRec()->getWidth(COMPONENT_Y) / iMaxCUWidth; 156 iNumCuInWidth += ( getPicYuvRec()->getWidth(COMPONENT_Y) % iMaxCUWidth ) ? 1 : 0; 157 158 159 Int iCuX = iX / iMaxCUWidth; 160 Int iCuY = iY / iMaxCuHeight; 161 Int iBaseX = ( iX - iCuX * iMaxCUWidth ) / iBaseUnitWidth; 162 Int iBaseY = ( iY - iCuY * iMaxCuHeight ) / iBaseUnitHeight; 163 Int iCuSizeInBases = iMaxCuHeight / iBaseUnitWidth; 164 165 riCuAddr = iCuY * iNumCuInWidth + iCuX; 166 Int iRastPartIdx = iBaseY * iCuSizeInBases + iBaseX; 167 riAbsZorderIdx = g_auiRasterToZscan[ iRastPartIdx ]; 168 } 169 #endif 145 170 Void TComPic::compressMotion(Int scale) 146 171 #else … … 283 308 return getPicYuv( layerIdInNuh, poc, recon ); 284 309 } 285 #if H_3D_ARP310 #if NH_3D_ARP 286 311 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh ) 287 312 { … … 303 328 #endif // NH_MV 304 329 305 #if H_3D_NBDV306 Int TComPic::getDisCandRefPictures( Int iColPOC)330 #if NH_3D_NBDV 331 Int TComPic::getDisCandRefPictures(Int iColPOC) 307 332 { 308 333 UInt uiTempLayerCurr = 7; … … 310 335 UInt numDdvCandPics = 0; 311 336 312 if ( !currSlice->getEnableTMVPFlag() ) 337 if(!currSlice->getEnableTMVPFlag()) 338 { 313 339 return numDdvCandPics; 340 } 314 341 315 342 numDdvCandPics += 1; … … 318 345 UInt pocDiff = 255; 319 346 320 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr 321 { 322 UIntx = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();323 324 for 347 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr++) 348 { 349 Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); 350 351 for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 325 352 { 326 353 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() 327 && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2)354 && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) && numDdvCandPics != 2) 328 355 { 329 356 TComSlice* refSlice = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx()); 330 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1: 0;357 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1 : 0; 331 358 UInt uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer(); 332 359 333 if( bRAP)360 if(bRAP) 334 361 { 335 362 this->setRapRefIdx(i); … … 350 377 UInt idx = 0; 351 378 352 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++)353 { 354 UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();379 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++) 380 { 381 Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); 355 382 356 for 383 for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 357 384 { 358 385 Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC(); 359 Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc);386 Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc); 360 387 361 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC)362 && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)388 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) 389 && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff) 363 390 { 364 391 pocDiff = iTempDiff; … … 369 396 } 370 397 371 if( pocDiff < 255)398 if(pocDiff < 255) 372 399 { 373 400 this->setRapRefIdx(idx); 374 this->setRapRefList((RefPicList) z 401 this->setRapRefList((RefPicList) z); 375 402 numDdvCandPics = 2; 376 403 } … … 383 410 TComSlice* currSlice = getSlice(getCurrSliceIdx()); 384 411 const Int numCandPics = this->getNumDdvCandPics(); 412 385 413 for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++) 386 414 { 387 415 RefPicList eCurRefPicList = REF_PIC_LIST_0 ; 388 416 Int curCandPicRefIdx = 0; 389 if( curCandPic == 0)417 if(curCandPic == 0) 390 418 { 391 eCurRefPicList = RefPicList(currSlice->isInterB() ? 1 -currSlice->getColFromL0Flag() : 0);419 eCurRefPicList = RefPicList(currSlice->isInterB() ? 1 - currSlice->getColFromL0Flag() : 0); 392 420 curCandPicRefIdx = currSlice->getColRefIdx(); 393 421 } … … 397 425 curCandPicRefIdx = this->getRapRefIdx(); 398 426 } 399 TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx); 400 TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice 427 428 TComPic* pcCandColPic = currSlice->getRefPic(eCurRefPicList, curCandPicRefIdx); 429 TComSlice* pcCandColSlice = pcCandColPic->getSlice(0); // currently only support single slice 401 430 402 431 if(!pcCandColSlice->isIntra()) 403 432 { 404 for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++)405 { 406 for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir); iColRefIdx++)433 for(Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2 : 1); iColRefDir++) 434 { 435 for(Int iColRefIdx = 0; iColRefIdx < pcCandColSlice->getNumRefIdx((RefPicList)iColRefDir); iColRefIdx++) 407 436 { 408 437 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false; 409 438 Int iColViewIdx = pcCandColSlice->getViewIndex(); 410 Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList)iColRefDir, iColRefIdx)->getViewIndex();439 Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex(); 411 440 if(iColViewIdx == iColRefViewIdx) 441 { 412 442 continue; 413 414 for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++) 443 } 444 445 for(Int iCurrRefDir = 0; (iCurrRefDir < (currSlice->isInterB() ? 2 : 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false); iCurrRefDir++) 415 446 { 416 for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir); iCurrRefIdx++)447 for(Int iCurrRefIdx = 0; iCurrRefIdx < currSlice->getNumRefIdx((RefPicList)iCurrRefDir); iCurrRefIdx++) 417 448 { 418 if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx)449 if(currSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iColRefViewIdx) 419 450 { 420 451 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true; … … 428 459 } 429 460 } 461 430 462 Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx) 431 463 { … … 433 465 } 434 466 435 Void TComPic::checkTextureRef( 467 Void TComPic::checkTextureRef() 436 468 { 437 469 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 438 TComPic* pcTextPic = pcCurrSlice->get TexturePic();470 TComPic* pcTextPic = pcCurrSlice->getIvPic(0, getViewIndex()); 439 471 #if H_3D_FCO 440 472 if ( pcTextPic ) 441 473 { 442 474 #endif 443 444 475 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 445 476 446 for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++)447 { 448 for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir); iTextRefIdx++)449 { 450 Int iTextRefPOC = pcTextSlice->getRefPOC( ( RefPicList)iTextRefDir, iTextRefIdx);451 Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex();477 for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++) 478 { 479 for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++) 480 { 481 Int iTextRefPOC = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx); 482 Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex(); 452 483 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 453 484 Int iCurrRefDir = iTextRefDir; 454 for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++) 485 486 for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++) 455 487 { 456 if( pcCurrSlice->getRefPOC( ( RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&457 pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)488 if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 489 pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId) 458 490 { 459 491 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; … … 461 493 } 462 494 } 463 464 495 } 465 496 #if H_3D_FCO
Note: See TracChangeset for help on using the changeset viewer.