Changeset 986 in 3DVCSoftware for branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon
- Timestamp:
- 14 Jul 2014, 04:08:54 (10 years ago)
- Location:
- branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp
r985 r986 1360 1360 } 1361 1361 } 1362 1363 #if QC_I0051_ARP_SIMP 1364 Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ) 1365 { 1366 Int iRefIdx = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr ); 1367 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); 1368 TComPic* pcPicYuvBaseCol = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 1369 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec(); 1370 Int uiLCUAddr,uiAbsPartAddr; 1371 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1372 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); 1373 1374 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1375 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1376 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1377 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1378 1379 TComPic* pcPicYuvBaseTRef = NULL; 1380 pcPicYuvCurrTRef = NULL; 1381 1382 //If there is available motion in base reference list, use it 1383 if(!pColCU->isIntra(uiAbsPartAddr)) 1384 { 1385 for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++) 1386 { 1387 RefPicList eRefPicListCurr = RefPicList(iList); 1388 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1389 if( iRef != -1) 1390 { 1391 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 1392 Int iCurrPOC = pColCU->getSlice()->getPOC(); 1393 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1394 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr); 1395 if( iCurrRef >= 0) 1396 { 1397 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); 1398 Int iTargetPOC = pcPicYuvCurrTRef->getPOC(); 1399 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic(iTargetPOC, pcPicYuvBaseCol->getViewIndex() ); 1400 if(pcPicYuvBaseTRef) 1401 { 1402 cBaseTMV = pColCU->getCUMvField(eRefPicListCurr)->getMv(uiAbsPartAddr); 1403 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC); 1404 if ( iScale != 4096 ) 1405 { 1406 cBaseTMV = cBaseTMV.scaleMv( iScale ); 1407 } 1408 iCurrTRefPoc = iTargetPOC; 1409 return true; 1410 } 1411 } 1412 } 1413 } 1414 } 1415 1416 //If there is no available motion in base reference list, use ( 0, 0 ) 1417 if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 ) 1418 { 1419 cBaseTMV.set( 0, 0 ); 1420 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList, pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) ); 1421 iCurrTRefPoc = pcPicYuvCurrTRef->getPOC(); 1422 return true; 1423 } 1424 1425 return false; 1426 } 1427 #endif 1428 1362 1429 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1363 1430 { … … 1393 1460 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1394 1461 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1395 1462 #if QC_I0051_ARP_SIMP 1463 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1464 { 1465 RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1466 Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr ); 1467 //The other prediction direction is temporal ARP 1468 if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ) 1469 { 1470 bTMVAvai = true; 1471 pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx ); 1472 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1473 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1474 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList ); 1475 1476 if( iCurrRef >= 0 ) 1477 { 1478 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef ); 1479 Int iTargetPOC = pcPicYuvCurrTRef->getPOC(); 1480 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iTargetPOC, pcPicYuvBaseCol->getViewIndex() ); 1481 if( pcPicYuvBaseTRef ) 1482 { 1483 cBaseTMV = pcCU->getCUMvField( eOtherRefList )->getMv( uiPartAddr ); 1484 Int iScale = pcCU-> xGetDistScaleFactor( iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC ); 1485 if ( iScale != 4096 ) 1486 { 1487 cBaseTMV = cBaseTMV.scaleMv( iScale ); 1488 } 1489 } 1490 else 1491 { 1492 dW = 0; 1493 } 1494 } 1495 else 1496 { 1497 dW = 0; 1498 } 1499 } 1500 1501 //Both prediction directions are inter-view ARP 1502 if ( iOtherRefIdx >= 0 && !bTMVAvai ) 1503 { 1504 RefPicList eBaseList = REF_PIC_LIST_0; 1505 Int iCurrTRefPoc; 1506 bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ); 1507 1508 if ( bTMVAvai ) 1509 { 1510 if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) ) 1511 { 1512 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc, pcPicYuvBaseCol->getViewIndex() ); 1513 if ( pcPicYuvBaseTRef == NULL ) 1514 { 1515 dW = 0; 1516 } 1517 } 1518 else 1519 { 1520 dW = 0; 1521 } 1522 } 1523 } 1524 } 1525 1526 if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai ) 1527 #else 1396 1528 if(!pColCU->isIntra(uiAbsPartAddr)) 1529 #endif 1397 1530 { 1398 1531 TComMvField puMVField; -
branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.h
r884 r986 90 90 #if H_3D_ARP 91 91 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 92 #if QC_I0051_ARP_SIMP 93 Bool xCheckBiInterviewARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ); 94 #endif 92 95 Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL ); 93 96 #endif -
branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TypeDef.h
r985 r986 284 284 #define H_3D_ARP_WFNR 3 285 285 #define QC_I0129_ARP_FIX 1 286 #define QC_I0051_ARP_SIMP 1 286 287 #endif 287 288
Note: See TracChangeset for help on using the changeset viewer.