Changeset 1270 in 3DVCSoftware for branches/HTM-14.1-update-dev3/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 13 Jul 2015, 15:22:02 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev3/source/Lib/TLibCommon/TComPrediction.cpp
r1267 r1270 123 123 m_cYuvPredTemp.destroy(); 124 124 125 #if H_3D_ARP125 #if NH_3D_ARP 126 126 m_acYuvPredBase[0].destroy(); 127 127 m_acYuvPredBase[1].destroy(); … … 182 182 183 183 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 184 #if H_3D_ARP185 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);186 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);184 #if NH_3D_ARP 185 m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 186 m_acYuvPredBase[1] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 187 187 #endif 188 188 #if NH_3D_VSP … … 648 648 Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC(); 649 649 Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC(); 650 #if H_3D_ARP650 #if NH_3D_ARP 651 651 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 652 652 #else … … 670 670 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 671 671 } 672 #if H_3D_ARP 672 #if H_3D_ARP // check this! 673 673 if( pcCU->getARPW( uiPartAddr ) != 0 ) 674 674 { … … 749 749 #endif 750 750 751 #if H_3D_DBBP751 #if NH_3D_DBBP 752 752 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 753 753 { 754 const TComSPS* sps = pcCU->getSlice()->getSPS(); 755 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 756 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 757 754 758 // find virtual partitioning for this CU based on depth block 755 759 // segmentation of texture block --> mask IDs … … 759 763 Int iSumDepth = 0; 760 764 Int iSubSample = 4; 761 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );762 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );765 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 766 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 763 767 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 764 768 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 766 770 cDv.setVer(0); 767 771 } 768 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);769 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);772 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 773 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 770 774 771 775 UInt t=0; … … 854 858 } 855 859 856 PartSize matchedPartSize = SIZE_NONE;860 PartSize matchedPartSize = NUMBER_OF_PART_SIZES; 857 861 858 862 Int iMaxMatchSum = 0; … … 869 873 } 870 874 871 AOF( matchedPartSize != SIZE_NONE);875 AOF( matchedPartSize != NUMBER_OF_PART_SIZES ); 872 876 873 877 return matchedPartSize; … … 876 880 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 877 881 { 882 const TComSPS* sps = pcCU->getSlice()->getSPS(); 883 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 884 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 885 878 886 // segmentation of texture block --> mask IDs 879 887 Pel* pDepthBlockStart = pDepthPels; … … 887 895 iSumDepth = pDepthPels[ 0 ]; 888 896 889 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );890 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );897 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 898 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 891 899 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 892 900 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 894 902 cDv.setVer(0); 895 903 } 896 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);897 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);904 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 905 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 898 906 if (iBlkX>(Int)(iPictureWidth - uiWidth)) 899 907 { … … 1010 1018 } 1011 1019 1012 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )1013 { 1014 Pel* piSrc[2] = {pInYuv[0]->get LumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};1015 UInt uiSrcStride = pInYuv[0]->getStride( );1016 Pel* piDst = pOutYuv->get LumaAddr(uiPartAddr);1017 UInt uiDstStride = pOutYuv->getStride( );1020 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ) 1021 { 1022 Pel* piSrc[2] = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)}; 1023 UInt uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y); 1024 Pel* piDst = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr); 1025 UInt uiDstStride = pOutYuv->getStride(COMPONENT_Y); 1018 1026 1019 1027 UInt uiMaskStride= MAX_CU_SIZE; … … 1054 1062 right = (x==uiWidth-1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 1055 1063 1056 piDst[x] = (l!=r) ? Clip Y( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];1064 piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1057 1065 } 1058 1066 piDst += uiDstStride; … … 1072 1080 bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 1073 1081 1074 piDst[x] = (t!=b) ? Clip Y( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];1082 piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1075 1083 } 1076 1084 piDst += uiDstStride; … … 1085 1093 1086 1094 // now combine chroma 1087 Pel* piSrcU[2] = { pInYuv[0]->get CbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };1088 Pel* piSrcV[2] = { pInYuv[0]->get CrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };1089 UInt uiSrcStrideC = pInYuv[0]->get CStride();1090 Pel* piDstU = pOutYuv->get CbAddr(uiPartAddr);1091 Pel* piDstV = pOutYuv->get CrAddr(uiPartAddr);1092 UInt uiDstStrideC = pOutYuv->get CStride();1095 Pel* piSrcU[2] = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) }; 1096 Pel* piSrcV[2] = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) }; 1097 UInt uiSrcStrideC = pInYuv[0]->getStride(COMPONENT_Cb); 1098 Pel* piDstU = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr); 1099 Pel* piDstV = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr); 1100 UInt uiDstStrideC = pOutYuv->getStride(COMPONENT_Cb); 1093 1101 UInt uiWidthC = uiWidth >> 1; 1094 1102 UInt uiHeightC = uiHeight >> 1; … … 1136 1144 if (l!=r) 1137 1145 { 1138 filSrcU = Clip C( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));1139 filSrcV = Clip C( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));1146 filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY); 1147 filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY); 1140 1148 } 1141 1149 else … … 1169 1177 if (t!=b) 1170 1178 { 1171 filSrcU = Clip C( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));1172 filSrcV = Clip C( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));1179 filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY); 1180 filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY); 1173 1181 } 1174 1182 else … … 1383 1391 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); 1384 1392 #endif 1385 #if H_3D_ARP 1386 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) 1387 { 1388 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); 1393 #if NH_3D_ARP 1394 if( pcCU->getARPW( uiPartAddr ) > 0 ) 1395 { 1396 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() ) 1397 { 1398 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi ); 1389 1399 } 1390 1400 else 1391 1401 { 1392 if( pcCU->getARPW( uiPartAddr ) > 0 1393 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 1394 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 1395 ) 1396 { 1397 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 1402 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi ); 1403 } 1398 1404 } 1399 1405 else … … 1403 1409 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 1404 1410 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1405 #if H_3D_ARP1411 #if NH_3D_ARP 1406 1412 , false 1407 1413 #endif … … 1409 1415 bICFlag = bICFlag && (iWidth > 8); 1410 1416 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1411 #if H_3D_ARP1417 #if NH_3D_ARP 1412 1418 , false 1413 1419 #endif … … 1421 1427 } 1422 1428 #endif 1423 #if H_3D_ARP 1424 } 1429 #if NH_3D_ARP 1425 1430 } 1426 1431 #endif … … 1472 1477 #endif 1473 1478 1474 #if H_3D_ARP 1475 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1476 { 1477 Int iRefIdx = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1478 TComMv cMv = pNewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1479 #if NH_3D_ARP 1480 //temporal ARP 1481 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1482 { 1483 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1484 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1479 1485 Bool bTobeScaled = false; 1480 1486 TComPic* pcPicYuvBaseCol = NULL; … … 1490 1496 UChar dW = pcCU->getARPW ( uiPartAddr ); 1491 1497 1492 {1493 1498 Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList); 1494 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() ) 1495 { 1496 bTobeScaled = true; 1497 } 1498 1499 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1500 1501 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1502 1503 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1499 if (arpRefIdx < 0 || !pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1504 1500 { 1505 1501 dW = 0; … … 1508 1504 else 1509 1505 { 1510 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() ); 1506 if( arpRefIdx != iRefIdx ) 1507 { 1508 bTobeScaled = true; 1509 } 1510 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1511 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1511 1512 } 1512 1513 … … 1515 1516 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1516 1517 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 1517 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0);1518 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx ); 1518 1519 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 1519 1520 if ( iScale != 4096 ) … … 1521 1522 cMv = cMv.scaleMv( iScale ); 1522 1523 } 1523 iRefIdx = 0; 1524 } 1524 iRefIdx = arpRefIdx; 1525 1525 } 1526 1526 1527 1527 pcCU->clipMv(cMv); 1528 1528 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 1529 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1530 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1529 1530 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1531 { 1532 const ComponentID compID=ComponentID(comp); 1533 xPredInterBlk ( compID, pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1534 } 1531 1535 1532 1536 if( dW > 0 ) … … 1544 1548 pcCU->clipMv( cNBDV ); 1545 1549 1546 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 1547 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1548 if (iWidth > 8) 1549 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1550 TComPicYuv* pcPicYuvBaseColRec = pcPicYuvBaseCol->getPicYuvRec(); 1551 TComPicYuv* pcPicYuvBaseRefRec = pcPicYuvBaseRef->getPicYuvRec(); 1550 1552 1551 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 1552 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1553 1554 if (iWidth > 8) 1555 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1553 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1554 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1555 { 1556 const ComponentID compID=ComponentID(comp); 1557 xPredInterBlk ( compID, pcCU, pcPicYuvBaseColRec, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1558 xPredInterBlk ( compID, pcCU, pcPicYuvBaseRefRec, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1559 } 1556 1560 1557 1561 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); … … 1561 1565 pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1562 1566 } 1563 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );1567 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1564 1568 } 1565 1569 } … … 1570 1574 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); 1571 1575 TComPic* pcPicYuvBaseCol = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 1572 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec();1573 Int uiLCUAddr,uiAbsPartAddr;1574 1576 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1575 1577 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1577 1579 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1578 1580 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1579 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1580 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1581 1582 Int uiLCUAddr,uiAbsPartAddr; 1583 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1584 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1581 1585 1582 1586 TComPic* pcPicYuvBaseTRef = NULL; … … 1630 1634 } 1631 1635 1632 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1636 //inter-view ARP 1637 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1633 1638 { 1634 1639 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); … … 1643 1648 Bool bTMVAvai = false; 1644 1649 TComMv cBaseTMV; 1645 if( pNewMvFiled ) 1646 { 1647 iRefIdx = pNewMvFiled->getRefIdx(); 1648 cDMv = pNewMvFiled->getMv(); 1649 } 1650 1650 1651 pcCU->clipMv(cTempDMv); 1651 1652 1652 assert(dW > 0);1653 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))1654 {1655 dW = 0;1656 }1657 Int uiLCUAddr,uiAbsPartAddr;1658 1653 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1659 1654 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1661 1656 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1662 1657 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1663 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1664 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1658 1659 Int uiLCUAddr,uiAbsPartAddr; 1660 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1661 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1665 1662 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1666 1663 { … … 1733 1730 RefPicList eRefPicListCurr = RefPicList(iList); 1734 1731 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1735 if( iRef != -1 )1732 if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex())) 1736 1733 { 1737 1734 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); … … 1767 1764 } 1768 1765 1769 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1770 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1771 1772 if( dW > 0 && bTMVAvai ) 1773 { 1766 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1767 { 1768 const ComponentID compID=ComponentID(comp); 1769 xPredInterBlk ( compID, pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), bTMVAvai ); 1770 } 1771 1772 if( dW > 0 ) 1773 { 1774 assert ( bTMVAvai ); 1774 1775 TComYuv* pYuvCurrTRef = &m_acYuvPredBase[0]; 1775 1776 TComYuv* pYuvBaseTRef = &m_acYuvPredBase[1]; … … 1785 1786 pYuvCurrTRef->clear(); pYuvBaseTRef->clear(); 1786 1787 } 1787 xPredInterLumaBlk ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1788 1789 if (iWidth > 8) 1790 xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1791 1792 xPredInterLumaBlk ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1793 1794 if (iWidth > 8) 1795 xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1788 1789 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1790 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1791 { 1792 const ComponentID compID=ComponentID(comp); 1793 xPredInterBlk ( compID, pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1794 xPredInterBlk ( compID, pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1795 } 1796 1796 1797 1797 pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); … … 1800 1800 pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1801 1801 } 1802 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );1802 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1803 1803 } 1804 1804 } … … 1898 1898 1899 1899 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth 1900 #if H_3D_ARP1900 #if NH_3D_ARP 1901 1901 , Bool filterType 1902 1902 #endif … … 1942 1942 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth 1943 1943 #endif 1944 #if H_3D_ARP1944 #if NH_3D_ARP 1945 1945 , filterType 1946 1946 #endif … … 1954 1954 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth 1955 1955 #endif 1956 #if H_3D_ARP1956 #if NH_3D_ARP 1957 1957 , filterType 1958 1958 #endif … … 1967 1967 1968 1968 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt, bitDepth 1969 #if H_3D_ARP1969 #if NH_3D_ARP 1970 1970 , filterType 1971 1971 #endif … … 1976 1976 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth 1977 1977 #endif 1978 #if H_3D_ARP1978 #if NH_3D_ARP 1979 1979 , filterType 1980 1980 #endif … … 2019 2019 } 2020 2020 2021 2022 #if H_3D_ARP2023 , Bool filterType2024 #endif2025 2021 #if H_3D_IC 2026 2022 , Bool bICFlag … … 2030 2026 #else 2031 2027 #endif 2032 #if H_3D_ARP2033 , filterType2034 #endif2035 2028 #if H_3D_IC 2036 2029 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 2037 2030 #else 2038 2031 #endif 2039 #if H_3D_ARP2040 , filterType2041 #endif2042 2032 #if H_3D_IC 2043 2033 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 2044 2034 #else 2045 2035 #endif 2046 #if H_3D_ARP2047 , filterType2048 #endif2049 2036 #if H_3D_IC 2050 2037 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 2051 2038 #else 2052 2039 #endif 2053 #if H_3D_ARP2054 , filterType2055 #endif2056 #if H_3D_ARP2057 , filterType2058 #endif2059 2040 #if H_3D_IC 2060 2041 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 2061 2042 #else 2062 2043 #endif 2063 #if H_3D_ARP2064 , filterType2065 #endif2066 #if H_3D_ARP2067 , filterType2068 #endif2069 2044 #if H_3D_IC 2070 2045 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 2071 2046 #else 2072 2047 #endif 2073 #if H_3D_ARP2074 , filterType2075 #endif2076 2048 #if H_3D_IC 2077 2049 if( bICFlag )
Note: See TracChangeset for help on using the changeset viewer.