Ignore:
Timestamp:
13 Jul 2015, 15:22:02 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev4-Qualcomm@1266

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev3/source/Lib/TLibCommon/TComPrediction.cpp

    r1267 r1270  
    123123  m_cYuvPredTemp.destroy();
    124124
    125 #if H_3D_ARP
     125#if NH_3D_ARP
    126126  m_acYuvPredBase[0].destroy();
    127127  m_acYuvPredBase[1].destroy();
     
    182182
    183183    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    184 #if H_3D_ARP
    185     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 );
    187187#endif
    188188#if NH_3D_VSP
     
    648648      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    649649      Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC();
    650 #if H_3D_ARP
     650#if NH_3D_ARP
    651651      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
    652652#else
     
    670670    pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
    671671  }
    672 #if H_3D_ARP
     672#if H_3D_ARP // check this!
    673673  if( pcCU->getARPW( uiPartAddr ) != 0 )
    674674  {
     
    749749#endif
    750750
    751 #if H_3D_DBBP
     751#if NH_3D_DBBP
    752752PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
    753753{
     754  const TComSPS* sps = pcCU->getSlice()->getSPS();
     755  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     756  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     757 
    754758  // find virtual partitioning for this CU based on depth block
    755759  // segmentation of texture block --> mask IDs
     
    759763  Int iSumDepth = 0;
    760764  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);
    763767  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    764768  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    766770    cDv.setVer(0);
    767771  }
    768   Int iBlkX = ( pcCU->getAddr() % 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->getAddr() / 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);
    770774 
    771775  UInt t=0;
     
    854858  }
    855859
    856   PartSize matchedPartSize = SIZE_NONE;
     860  PartSize matchedPartSize = NUMBER_OF_PART_SIZES;
    857861
    858862  Int iMaxMatchSum = 0;
     
    869873  }
    870874
    871   AOF( matchedPartSize != SIZE_NONE );
     875  AOF( matchedPartSize != NUMBER_OF_PART_SIZES );
    872876
    873877  return matchedPartSize;
     
    876880Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU)
    877881{
     882  const TComSPS* sps = pcCU->getSlice()->getSPS();
     883  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     884  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     885 
    878886  // segmentation of texture block --> mask IDs
    879887  Pel*  pDepthBlockStart      = pDepthPels;
     
    887895  iSumDepth  = pDepthPels[ 0 ];
    888896 
    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); 
    891899  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    892900  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    894902    cDv.setVer(0);
    895903  }
    896   Int iBlkX = ( pcCU->getAddr() % 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->getAddr() / 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);
    898906  if (iBlkX>(Int)(iPictureWidth - uiWidth))
    899907  {
     
    10101018}
    10111019
    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]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
    1015   UInt  uiSrcStride = pInYuv[0]->getStride();
    1016   Pel*  piDst       = pOutYuv->getLumaAddr(uiPartAddr);
    1017   UInt  uiDstStride = pOutYuv->getStride();
     1020Void 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);
    10181026 
    10191027  UInt  uiMaskStride= MAX_CU_SIZE;
     
    10541062        right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
    10551063       
    1056         piDst[x] = (l!=r) ? ClipY( 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];
    10571065      }
    10581066      piDst     += uiDstStride;
     
    10721080        bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
    10731081       
    1074         piDst[x] = (t!=b) ? ClipY( 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];
    10751083      }
    10761084      piDst     += uiDstStride;
     
    10851093 
    10861094  // now combine chroma
    1087   Pel*  piSrcU[2]       = { pInYuv[0]->getCbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };
    1088   Pel*  piSrcV[2]       = { pInYuv[0]->getCrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };
    1089   UInt  uiSrcStrideC    = pInYuv[0]->getCStride();
    1090   Pel*  piDstU          = pOutYuv->getCbAddr(uiPartAddr);
    1091   Pel*  piDstV          = pOutYuv->getCrAddr(uiPartAddr);
    1092   UInt  uiDstStrideC    = pOutYuv->getCStride();
     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);
    10931101  UInt  uiWidthC        = uiWidth >> 1;
    10941102  UInt  uiHeightC       = uiHeight >> 1;
     
    11361144        if (l!=r)
    11371145        {
    1138           filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
    1139           filSrcV = ClipC( 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);
    11401148        }
    11411149        else
     
    11691177        if (t!=b)
    11701178        {
    1171           filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));
    1172           filSrcV = ClipC( 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);
    11731181        }
    11741182        else
     
    13831391  pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx );
    13841392#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 );
    13891399  }
    13901400  else
    13911401  {
    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    }     
    13981404    }
    13991405    else
     
    14031409      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );
    14041410      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    1405 #if H_3D_ARP
     1411#if NH_3D_ARP
    14061412        , false
    14071413#endif
     
    14091415      bICFlag = bICFlag && (iWidth > 8);
    14101416      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    1411 #if H_3D_ARP
     1417#if NH_3D_ARP
    14121418        , false
    14131419#endif
     
    14211427  }
    14221428#endif
    1423 #if H_3D_ARP
    1424     }
     1429#if NH_3D_ARP
    14251430  }
    14261431#endif
     
    14721477#endif
    14731478
    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
     1481Void 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 );
    14791485  Bool        bTobeScaled  = false;
    14801486  TComPic* pcPicYuvBaseCol = NULL;
     
    14901496  UChar dW = pcCU->getARPW ( uiPartAddr );
    14911497
    1492   {
    14931498    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))
    15041500    {
    15051501      dW = 0;
     
    15081504    else
    15091505    {
    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 );
    15111512    }
    15121513
     
    15151516      Int iCurrPOC    = pcCU->getSlice()->getPOC();
    15161517      Int iColRefPOC  = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx );
    1517       Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList,  0);
     1518    Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx );
    15181519      Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC);
    15191520      if ( iScale != 4096 )
     
    15211522        cMv = cMv.scaleMv( iScale );
    15221523      }
    1523       iRefIdx = 0;
    1524     }
     1524    iRefIdx = arpRefIdx;
    15251525  }
    15261526
    15271527  pcCU->clipMv(cMv);
    15281528  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  }
    15311535
    15321536  if( dW > 0 )
     
    15441548    pcCU->clipMv( cNBDV );
    15451549   
    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();
    15501552   
    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    }   
    15561560   
    15571561    pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
     
    15611565      pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    15621566    }
    1563     rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );
     1567    rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
    15641568  }
    15651569}
     
    15701574  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
    15711575  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 
    1572   TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
    1573   Int uiLCUAddr,uiAbsPartAddr;
    15741576  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    15751577  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    15771579  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    15781580  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 );
    15811585
    15821586  TComPic* pcPicYuvBaseTRef = NULL;
     
    16301634}
    16311635
    1632 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
     1636//inter-view ARP
     1637Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    16331638{
    16341639  Int         iRefIdx       = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     
    16431648  Bool bTMVAvai = false;     
    16441649  TComMv cBaseTMV;
    1645   if( pNewMvFiled )
    1646   {
    1647     iRefIdx = pNewMvFiled->getRefIdx();
    1648     cDMv = pNewMvFiled->getMv();
    1649   }
     1650
    16501651  pcCU->clipMv(cTempDMv);
    16511652
    1652   assert(dW > 0);
    1653   if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))
    1654   {
    1655     dW = 0;
    1656   }
    1657   Int uiLCUAddr,uiAbsPartAddr;
    16581653  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    16591654  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    16611656  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    16621657  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 );
    16651662  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
    16661663  {
     
    17331730      RefPicList eRefPicListCurr = RefPicList(iList);
    17341731      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
    1735       if( iRef != -1)
     1732      if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex()))
    17361733      {
    17371734        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 
     
    17671764  }
    17681765
    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 );
    17741775    TComYuv*    pYuvCurrTRef    = &m_acYuvPredBase[0];
    17751776    TComYuv*    pYuvBaseTRef    = &m_acYuvPredBase[1];
     
    17851786      pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
    17861787    }
    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    }
    17961796
    17971797    pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); 
     
    18001800      pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    18011801    }
    1802     rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );
     1802    rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
    18031803  }
    18041804}
     
    18981898
    18991899Void 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_ARP
     1900#if NH_3D_ARP
    19011901    , Bool filterType
    19021902#endif
     
    19421942    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth
    19431943#endif
    1944 #if H_3D_ARP
     1944#if NH_3D_ARP
    19451945    , filterType
    19461946#endif
     
    19541954    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth
    19551955#endif
    1956 #if H_3D_ARP
     1956#if NH_3D_ARP
    19571957    , filterType
    19581958#endif
     
    19671967
    19681968    m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false,      chFmt, bitDepth
    1969 #if H_3D_ARP
     1969#if NH_3D_ARP
    19701970    , filterType
    19711971#endif
     
    19761976    m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi, chFmt, bitDepth
    19771977#endif
    1978 #if H_3D_ARP
     1978#if NH_3D_ARP
    19791979    , filterType
    19801980#endif
     
    20192019}
    20202020
    2021 
    2022 #if H_3D_ARP
    2023     , Bool filterType
    2024 #endif
    20252021#if H_3D_IC
    20262022    , Bool bICFlag
     
    20302026#else
    20312027#endif
    2032 #if H_3D_ARP
    2033     , filterType
    2034 #endif
    20352028#if H_3D_IC
    20362029    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
    20372030#else
    20382031#endif
    2039 #if H_3D_ARP
    2040     , filterType
    2041 #endif
    20422032#if H_3D_IC
    20432033    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
    20442034#else
    20452035#endif
    2046 #if H_3D_ARP
    2047     , filterType
    2048 #endif
    20492036#if H_3D_IC
    20502037    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
    20512038#else
    20522039#endif
    2053 #if H_3D_ARP
    2054     , filterType
    2055 #endif
    2056 #if H_3D_ARP
    2057     , filterType
    2058 #endif 
    20592040#if H_3D_IC
    20602041    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
    20612042#else
    20622043#endif
    2063 #if H_3D_ARP
    2064     , filterType
    2065 #endif
    2066 #if H_3D_ARP
    2067     , filterType
    2068 #endif
    20692044#if H_3D_IC
    20702045    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
    20712046#else
    20722047#endif
    2073 #if H_3D_ARP
    2074     , filterType
    2075 #endif
    20762048#if H_3D_IC
    20772049  if( bICFlag )
Note: See TracChangeset for help on using the changeset viewer.