Ticket #89: ticket89.patch
File ticket89.patch, 14.7 KB (added by Tomohiro Ikai, 9 years ago) |
---|
-
Lib/TLibCommon/TComPrediction.cpp
1194 1194 } else 1195 1195 #endif 1196 1196 #if H_3D_ARP 1197 #if FIX_TICKET_89_CLEAN 1198 if (pcCU->getARPW( uiPartAddr ) > 0) 1199 { 1200 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC() == pcCU->getSlice()->getPOC()) 1201 { 1202 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); 1203 } 1204 else 1205 { 1206 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 1207 } 1208 } 1209 else 1210 { 1211 #else 1197 1212 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) 1198 1213 { 1199 1214 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); … … 1210 1225 else 1211 1226 { 1212 1227 #endif 1228 #endif // FIX_TICKET_89_CLEAN 1213 1229 #if H_3D_IC 1214 1230 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 1215 1231 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi … … 1228 1244 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 1229 1245 #endif 1230 1246 #if H_3D_ARP 1247 #if !FIX_TICKET_89_CLEAN 1231 1248 } 1249 #endif 1232 1250 } 1233 1251 #endif 1234 1252 } … … 1280 1298 #endif 1281 1299 1282 1300 #if H_3D_ARP 1301 #if FIX_TICKET_89_CLEAN 1302 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi) 1303 #else 1283 1304 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1305 #endif 1284 1306 { 1307 #if FIX_TICKET_89_CLEAN 1308 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1309 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1310 #else 1285 1311 Int iRefIdx = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1286 1312 TComMv cMv = pNewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1313 #endif 1287 1314 Bool bTobeScaled = false; 1288 1315 TComPic* pcPicYuvBaseCol = NULL; 1289 1316 TComPic* pcPicYuvBaseRef = NULL; … … 1329 1356 { 1330 1357 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1331 1358 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 1359 #if FIX_TICKET_89_REFIDX 1360 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx); 1361 #else 1332 1362 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0); 1363 #endif 1333 1364 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 1334 1365 if ( iScale != 4096 ) 1335 1366 { 1336 1367 cMv = cMv.scaleMv( iScale ); 1337 1368 } 1369 #if FIX_TICKET_89_REFIDX 1370 iRefIdx = arpRefIdx; 1371 #else 1338 1372 iRefIdx = 0; 1373 #endif 1339 1374 } 1340 1375 } 1341 1376 … … 1382 1417 } 1383 1418 } 1384 1419 1420 #if FIX_TICKET_89_CLEAN2 1421 Bool TComPrediction::xGetMotionVectorAndRefPicListARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc, RefPicList &eRefPicListCurr ) 1422 #elif FIX_TICKET_89_REFCHECK 1423 Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc, RefPicList &eRefPicListCurr ) 1424 #else 1385 1425 Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ) 1426 #endif 1386 1427 { 1387 1428 Int iRefIdx = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr ); 1388 1429 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); … … 1405 1446 { 1406 1447 for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++) 1407 1448 { 1449 #if FIX_TICKET_89_CLEAN2 || FIX_TICKET_89_REFCHECK 1450 eRefPicListCurr = RefPicList(iList); 1451 #else 1408 1452 RefPicList eRefPicListCurr = RefPicList(iList); 1453 #endif 1409 1454 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1410 1455 if( iRef != -1) 1411 1456 { … … 1436 1481 } 1437 1482 1438 1483 //If there is no available motion in base reference list, use ( 0, 0 ) 1484 //When availFlag is equal to 0 and RpRefIdxLW is not equal to -1, availFlag is set equal to 1, mvT is set equal to ( 0, 0 ), Z is set equal to W 1439 1485 if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 ) 1440 1486 { 1441 1487 cBaseTMV.set( 0, 0 ); 1442 1488 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList, pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) ); 1443 1489 iCurrTRefPoc = pcPicYuvCurrTRef->getPOC(); 1490 #if FIX_TICKET_89_CLEAN2 || FIX_TICKET_89_REFCHECK 1491 eRefPicListCurr = eBaseRefPicList; 1492 #endif 1444 1493 return true; 1445 1494 } 1446 1495 … … 1447 1496 return false; 1448 1497 } 1449 1498 1499 #if FIX_TICKET_89_CLEAN 1500 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi) 1501 #else 1450 1502 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1503 #endif 1451 1504 { 1452 1505 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1453 1506 TComMv cDMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); … … 1460 1513 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec(); 1461 1514 Bool bTMVAvai = false; 1462 1515 TComMv cBaseTMV; 1516 #if FIX_TICKET_89_CLEAN || FIX_TICKET_89_REFCHECK 1517 RefPicList eRefPicListCurr; // Z 1518 #endif 1519 #if !FIX_TICKET_89_CLEAN 1463 1520 if( pNewMvFiled ) 1464 1521 { 1465 1522 iRefIdx = pNewMvFiled->getRefIdx(); 1466 1523 cDMv = pNewMvFiled->getMv(); 1467 1524 } 1525 #endif 1468 1526 pcCU->clipMv(cTempDMv); 1469 1527 1470 1528 assert(dW > 0); 1529 #if !FIX_TICKET_89_REFCHECK 1471 1530 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex())) 1472 1531 { 1473 1532 dW = 0; 1474 1533 } 1534 #endif 1475 1535 Int uiLCUAddr,uiAbsPartAddr; 1476 1536 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1477 1537 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1479 1539 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1480 1540 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1481 1541 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1542 #if !FIX_TICKET_89_CLEAN2 1482 1543 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1544 #endif 1545 #if !FIX_TICKET_89_CLEAN2 1546 { 1547 #elif FIX_TICKET_89_CLEAN 1548 if( pcCU->getSlice()->isInterB() ) 1549 #else 1483 1550 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1551 #endif 1484 1552 { 1485 1553 RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1486 1554 Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr ); 1487 1555 //The other prediction direction is temporal ARP 1556 #if FIX_TICKET_89_CLEAN || FIX_TICKET_89_REFCHECK 1557 Bool predFlagLY = iOtherRefIdx >= 0; 1558 Bool ivRefFlagLY = predFlagLY && pcCU->getSlice()->getPOC() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getPOC(); 1559 if( predFlagLY && ivRefFlagLY == 0) 1560 { 1561 eRefPicListCurr = eOtherRefList; 1562 #elif FIX_TICKET_89_CLEAN 1563 // If predFlagLY is equal to 1 and ivRefFlagLY is equal to 0 1564 if( iOtherRefIdx >= 0 && pcCU->getSlice()->getPOC() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getPOC() ) 1565 { 1566 #else 1488 1567 if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ) 1489 1568 { 1569 #endif 1570 #if !FIX_TICKET_89_REFCHECK 1571 // move the following condition to a later stage to confirm the condition of "RpRefIdxLY is not equal to -1". 1490 1572 bTMVAvai = true; 1573 #endif 1491 1574 pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx ); 1492 1575 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1493 1576 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1494 1577 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList ); 1495 1578 1579 // When RpRefIdxLY is not equal to -1, the following applies: 1496 1580 if( iCurrRef >= 0 ) 1497 1581 { 1582 #if FIX_TICKET_89_REFCHECK 1583 bTMVAvai = true; 1584 #endif 1498 1585 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef ); 1499 1586 Int iTargetPOC = pcPicYuvCurrTRef->getPOC(); 1500 1587 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iTargetPOC, pcPicYuvBaseCol->getViewIndex() ); … … 1507 1594 cBaseTMV = cBaseTMV.scaleMv( iScale ); 1508 1595 } 1509 1596 } 1597 #if FIX_TICKET_89_REFCHECK 1598 } 1599 #else 1600 // we can remove the following checks. The later check of "bTMVAvai && getArpRefPicAvailable" can take care of that. 1510 1601 else 1511 1602 { 1512 1603 dW = 0; … … 1516 1607 { 1517 1608 dW = 0; 1518 1609 } 1610 #endif 1519 1611 } 1612 #if FIX_TICKET_89_CLEAN2 1613 else // Otherwise (predFlagLY is equal to 0 or ivRefFlagLY is equal to 1) 1614 { 1615 RefPicList eRefPicListW = ( predFlagLY && ivRefFlagLY ) ? REF_PIC_LIST_0 : eRefPicList; 1616 Int iCurrTRefPoc; 1520 1617 1618 bTMVAvai = xGetMotionVectorAndRefPicListARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicListW, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc, eRefPicListCurr ); 1619 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc, pcPicYuvBaseCol->getViewIndex() ); 1620 } 1621 } 1622 #else 1521 1623 //Both prediction directions are inter-view ARP 1522 1624 if ( iOtherRefIdx >= 0 && !bTMVAvai ) 1523 1625 { 1524 1626 RefPicList eBaseList = REF_PIC_LIST_0; 1525 1627 Int iCurrTRefPoc; 1628 1526 1629 bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ); 1527 1630 1631 #if FIX_TICKET_89_REFCHECK 1528 1632 if ( bTMVAvai ) 1529 1633 { 1634 bTMVAvai = xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc, eRefPicListCurr ); 1635 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc, pcPicYuvBaseCol->getViewIndex() ); 1636 } 1637 #else 1638 if ( bTMVAvai ) 1639 { 1530 1640 if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) ) 1531 1641 { 1532 1642 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc, pcPicYuvBaseCol->getViewIndex() ); … … 1540 1650 dW = 0; 1541 1651 } 1542 1652 } 1653 #endif 1543 1654 } 1544 1655 } 1545 1656 … … 1576 1687 } 1577 1688 } 1578 1689 } 1690 1579 1691 if (bTMVAvai == false) 1580 1692 { 1581 1693 bTMVAvai = true; … … 1583 1695 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicList, pcCU->getSlice()->getFirstTRefIdx(eRefPicList)); 1584 1696 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic (eRefPicList, pcCU->getSlice()->getFirstTRefIdx(eRefPicList)); 1585 1697 } 1698 #endif // FIX_TICKET_89_CLEAN2 1586 1699 1587 1700 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1588 1701 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1589 1702 1703 #if FIX_TICKET_89_REFCHECK 1704 if (bTMVAvai && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex())) 1705 #else 1590 1706 if( dW > 0 && bTMVAvai ) 1707 #endif 1591 1708 { 1592 1709 TComYuv* pYuvCurrTRef = &m_acYuvPredBase[0]; 1593 1710 TComYuv* pYuvBaseTRef = &m_acYuvPredBase[1]; -
Lib/TLibCommon/TComPrediction.h
88 88 89 89 // motion compensation functions 90 90 #if H_3D_ARP 91 #if FIX_TICKET_89_CLEAN 92 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false); 93 #else 91 94 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 95 #endif 96 #if FIX_TICKET_89_CLEAN2 97 Bool xGetMotionVectorAndRefPicListARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc, RefPicList &eRefPicListCurr ); 98 #elif FIX_TICKET_89_REFCHECK 99 Bool xCheckBiInterviewARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc, RefPicList& eRefPicListCurr); 100 #else 92 101 Bool xCheckBiInterviewARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ); 102 #endif 103 #if FIX_TICKET_89_CLEAN 104 Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi); 105 #else 93 106 Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL ); 94 107 #endif 108 #endif 95 109 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false ); 96 110 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); 97 111 #if H_3D_VSP -
Lib/TLibCommon/TypeDef.h
67 67 #define NTT_BUG_FIX_TK54 1 68 68 #define BUG_FIX_TK65 1 69 69 70 #define FIX_TICKET_89_CLEAN 1 71 #define FIX_TICKET_89_CLEAN2 1 72 #define FIX_TICKET_89_REFIDX 1 73 #define FIX_TICKET_89_REFCHECK 1 74 75 70 76 #define MTK_I0093 1 71 77 ///////////////////////////////////////////////////////////////////////////////////////// 72 78 /////////////////////////////////// MAJOR DEFINES ///////////////////////////////////