Changeset 1030 in 3DVCSoftware for branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 30 Jul 2014, 19:51:27 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r1029 r1030 568 568 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 569 569 } 570 #if SHARP_ARP_CHROMA_I0104 571 if( pcCU->getARPW( uiPartAddr ) != 0 ) 572 { 573 return; 574 } 575 #endif 570 576 // horizontal sub-PU merge 571 577 for (Int i=0; i<iNumSP; i++) … … 1469 1475 pcCU->clipMv(cMv); 1470 1476 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 1477 #if QC_I0129_ARP_FIX 1478 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1479 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1480 #else 1471 1481 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 1472 1482 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 1473 1483 #endif 1474 1484 if( dW > 0 ) 1475 1485 { … … 1479 1489 TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV; 1480 1490 pcCU->clipMv(cMVwithDisparity); 1491 #if SHARP_ARP_CHROMA_I0104 1492 if (iWidth <= 8) 1493 { 1494 pYuvB0->clear(); pYuvB1->clear(); 1495 } 1496 #endif 1481 1497 1482 1498 assert ( cDistparity.bDV ); … … 1487 1503 1488 1504 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 1505 #if QC_I0129_ARP_FIX 1506 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1507 #if SHARP_ARP_CHROMA_I0104 1508 if (iWidth > 8) 1509 #endif 1510 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1511 #else 1489 1512 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true ); 1490 1513 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true ); 1514 #endif 1491 1515 #else 1492 1516 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); … … 1496 1520 1497 1521 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 1522 #if QC_I0129_ARP_FIX 1523 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1524 #if SHARP_ARP_CHROMA_I0104 1525 if (iWidth > 8) 1526 #endif 1527 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1528 #else 1498 1529 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 1499 1530 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 1500 1531 #endif 1501 1532 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); 1502 1533 … … 1508 1539 } 1509 1540 } 1541 1542 #if QC_I0051_ARP_SIMP 1543 Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ) 1544 { 1545 Int iRefIdx = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr ); 1546 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); 1547 TComPic* pcPicYuvBaseCol = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 1548 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec(); 1549 Int uiLCUAddr,uiAbsPartAddr; 1550 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1551 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); 1552 1553 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1554 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1555 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1556 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1557 1558 TComPic* pcPicYuvBaseTRef = NULL; 1559 pcPicYuvCurrTRef = NULL; 1560 1561 //If there is available motion in base reference list, use it 1562 if(!pColCU->isIntra(uiAbsPartAddr)) 1563 { 1564 for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++) 1565 { 1566 RefPicList eRefPicListCurr = RefPicList(iList); 1567 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1568 if( iRef != -1) 1569 { 1570 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 1571 Int iCurrPOC = pColCU->getSlice()->getPOC(); 1572 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1573 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr); 1574 #if MTK_I0072_IVARP_SCALING_FIX 1575 if( iCurrRef >= 0 && iCurrPOC != iCurrRefPOC) 1576 #else 1577 if( iCurrRef >= 0) 1578 #endif 1579 { 1580 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); 1581 Int iTargetPOC = pcPicYuvCurrTRef->getPOC(); 1582 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic(iTargetPOC, pcPicYuvBaseCol->getViewIndex() ); 1583 if(pcPicYuvBaseTRef) 1584 { 1585 cBaseTMV = pColCU->getCUMvField(eRefPicListCurr)->getMv(uiAbsPartAddr); 1586 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC); 1587 if ( iScale != 4096 ) 1588 { 1589 cBaseTMV = cBaseTMV.scaleMv( iScale ); 1590 } 1591 iCurrTRefPoc = iTargetPOC; 1592 return true; 1593 } 1594 } 1595 } 1596 } 1597 } 1598 1599 //If there is no available motion in base reference list, use ( 0, 0 ) 1600 if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 ) 1601 { 1602 cBaseTMV.set( 0, 0 ); 1603 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList, pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) ); 1604 iCurrTRefPoc = pcPicYuvCurrTRef->getPOC(); 1605 return true; 1606 } 1607 1608 return false; 1609 } 1610 #endif 1611 1510 1612 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1511 1613 { … … 1541 1643 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1542 1644 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1543 1645 #if QC_I0051_ARP_SIMP 1646 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1647 { 1648 RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1649 Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr ); 1650 //The other prediction direction is temporal ARP 1651 if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ) 1652 { 1653 bTMVAvai = true; 1654 pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx ); 1655 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1656 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1657 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList ); 1658 1659 if( iCurrRef >= 0 ) 1660 { 1661 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef ); 1662 Int iTargetPOC = pcPicYuvCurrTRef->getPOC(); 1663 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iTargetPOC, pcPicYuvBaseCol->getViewIndex() ); 1664 if( pcPicYuvBaseTRef ) 1665 { 1666 cBaseTMV = pcCU->getCUMvField( eOtherRefList )->getMv( uiPartAddr ); 1667 Int iScale = pcCU-> xGetDistScaleFactor( iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC ); 1668 if ( iScale != 4096 ) 1669 { 1670 cBaseTMV = cBaseTMV.scaleMv( iScale ); 1671 } 1672 } 1673 else 1674 { 1675 dW = 0; 1676 } 1677 } 1678 else 1679 { 1680 dW = 0; 1681 } 1682 } 1683 1684 //Both prediction directions are inter-view ARP 1685 if ( iOtherRefIdx >= 0 && !bTMVAvai ) 1686 { 1687 RefPicList eBaseList = REF_PIC_LIST_0; 1688 Int iCurrTRefPoc; 1689 bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() ); 1690 1691 if ( bTMVAvai ) 1692 { 1693 if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) ) 1694 { 1695 pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc, pcPicYuvBaseCol->getViewIndex() ); 1696 if ( pcPicYuvBaseTRef == NULL ) 1697 { 1698 dW = 0; 1699 } 1700 } 1701 else 1702 { 1703 dW = 0; 1704 } 1705 } 1706 } 1707 } 1708 1709 if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai ) 1710 #else 1544 1711 if(!pColCU->isIntra(uiAbsPartAddr)) 1712 #endif 1545 1713 { 1546 1714 TComMvField puMVField; … … 1555 1723 Int iCurrRefPOC = pcPicYuvBaseTRef->getPOC(); 1556 1724 Int iCurrRef = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr); 1725 #if MTK_I0072_IVARP_SCALING_FIX 1726 if (iCurrRef >= 0 && iCurrRefPOC != iCurrPOC) 1727 #else 1557 1728 if( iCurrRef >= 0) 1729 #endif 1558 1730 { 1559 1731 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); … … 1582 1754 pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic (eRefPicList, pcCU->getSlice()->getFirstTRefIdx(eRefPicList)); 1583 1755 } 1584 1756 #if QC_I0129_ARP_FIX 1757 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1758 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1759 #else 1585 1760 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi, bTMVAvai); 1586 1761 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi, bTMVAvai); 1587 1762 #endif 1588 1763 if( dW > 0 && bTMVAvai ) 1589 1764 { … … 1596 1771 pcCU->clipMv(cBaseTMV); 1597 1772 pcCU->clipMv(cTempMv); 1598 1773 #if SHARP_ARP_CHROMA_I0104 1774 if (iWidth <= 8) 1775 { 1776 pYuvCurrTRef->clear(); pYuvBaseTRef->clear(); 1777 } 1778 #endif 1779 #if QC_I0129_ARP_FIX 1780 xPredInterLumaBlk ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1781 #if SHARP_ARP_CHROMA_I0104 1782 if (iWidth > 8) 1783 #endif 1784 xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1785 xPredInterLumaBlk ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1786 #if SHARP_ARP_CHROMA_I0104 1787 if (iWidth > 8) 1788 #endif 1789 xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1790 #else 1599 1791 xPredInterLumaBlk ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi, true); 1600 1792 xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi, true); … … 1602 1794 xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, bi, true); 1603 1795 1796 #endif 1604 1797 pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); 1605 1798 if(dW == 2) … … 2135 2328 Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride(); 2136 2329 Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride(); 2330 #if SEC_IC_NEIGHBOR_CLIP_I0080 2331 Int iRefOffset, iHor, iVer; 2332 #else 2137 2333 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset, iHor, iVer; 2138 2334 2139 2335 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 2140 2336 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 2337 #endif 2141 2338 iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 ); 2142 2339 iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 ); 2340 #if !SEC_IC_NEIGHBOR_CLIP_I0080 2143 2341 iRefX = iCUPelX + iHor; 2144 2342 iRefY = iCUPelY + iVer; 2343 #endif 2145 2344 if( eType != TEXT_LUMA ) 2146 2345 { … … 2158 2357 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 2159 2358 2359 #if SEC_IC_NEIGHBOR_CLIP_I0080 2360 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) ) 2361 #else 2160 2362 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) 2363 #endif 2161 2364 { 2162 2365 iRefOffset = iHor + iVer * iRefStride - iRefStride; … … 2188 2391 } 2189 2392 2190 2393 #if SEC_IC_NEIGHBOR_CLIP_I0080 2394 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) ) 2395 #else 2191 2396 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelX > 0 && iRefX > 0 ) 2397 #endif 2192 2398 { 2193 2399 iRefOffset = iHor + iVer * iRefStride - 1;
Note: See TracChangeset for help on using the changeset viewer.