Ignore:
Timestamp:
21 May 2015, 15:43:58 (10 years ago)
Author:
rwth
Message:
  • migration of DBBP (to be tested)
File:
1 edited

Legend:

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

    r1210 r1222  
    747747#endif
    748748
    749 #if H_3D_DBBP
     749#if NH_3D_DBBP
    750750PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
    751751{
     752  const TComSPS* sps = pcCU->getSlice()->getSPS();
     753  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     754  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     755 
    752756  // find virtual partitioning for this CU based on depth block
    753757  // segmentation of texture block --> mask IDs
     
    757761  Int iSumDepth = 0;
    758762  Int iSubSample = 4;
    759   Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
    760   Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight();
     763  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y);
     764  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y);
    761765  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    762766  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    764768    cDv.setVer(0);
    765769  }
    766   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);
    767   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);
     770  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);
     771  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);
    768772 
    769773  UInt t=0;
     
    852856  }
    853857
    854   PartSize matchedPartSize = SIZE_NONE;
     858  PartSize matchedPartSize = NUMBER_OF_PART_SIZES;
    855859
    856860  Int iMaxMatchSum = 0;
     
    867871  }
    868872
    869   AOF( matchedPartSize != SIZE_NONE );
     873  AOF( matchedPartSize != NUMBER_OF_PART_SIZES );
    870874
    871875  return matchedPartSize;
     
    874878Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU)
    875879{
     880  const TComSPS* sps = pcCU->getSlice()->getSPS();
     881  UInt uiMaxCUWidth = sps->getMaxCUWidth();
     882  UInt uiMaxCUHeight = sps->getMaxCUHeight();
     883 
    876884  // segmentation of texture block --> mask IDs
    877885  Pel*  pDepthBlockStart      = pDepthPels;
     
    885893  iSumDepth  = pDepthPels[ 0 ];
    886894 
    887   Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
    888   Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); 
     895  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y);
     896  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 
    889897  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
    890898  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     
    892900    cDv.setVer(0);
    893901  }
    894   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);
    895   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);
     902  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);
     903  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);
    896904  if (iBlkX>(Int)(iPictureWidth - uiWidth))
    897905  {
     
    10081016}
    10091017
    1010 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )
    1011 {
    1012   Pel*  piSrc[2]    = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
    1013   UInt  uiSrcStride = pInYuv[0]->getStride();
    1014   Pel*  piDst       = pOutYuv->getLumaAddr(uiPartAddr);
    1015   UInt  uiDstStride = pOutYuv->getStride();
     1018Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY )
     1019{
     1020  Pel*  piSrc[2]    = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)};
     1021  UInt  uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y);
     1022  Pel*  piDst       = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr);
     1023  UInt  uiDstStride = pOutYuv->getStride(COMPONENT_Y);
    10161024 
    10171025  UInt  uiMaskStride= MAX_CU_SIZE;
     
    10521060        right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
    10531061       
    1054         piDst[x] = (l!=r) ? ClipY( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];
     1062        piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x];
    10551063      }
    10561064      piDst     += uiDstStride;
     
    10701078        bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
    10711079       
    1072         piDst[x] = (t!=b) ? ClipY( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];
     1080        piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x];
    10731081      }
    10741082      piDst     += uiDstStride;
     
    10831091 
    10841092  // now combine chroma
    1085   Pel*  piSrcU[2]       = { pInYuv[0]->getCbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };
    1086   Pel*  piSrcV[2]       = { pInYuv[0]->getCrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };
    1087   UInt  uiSrcStrideC    = pInYuv[0]->getCStride();
    1088   Pel*  piDstU          = pOutYuv->getCbAddr(uiPartAddr);
    1089   Pel*  piDstV          = pOutYuv->getCrAddr(uiPartAddr);
    1090   UInt  uiDstStrideC    = pOutYuv->getCStride();
     1093  Pel*  piSrcU[2]       = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) };
     1094  Pel*  piSrcV[2]       = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) };
     1095  UInt  uiSrcStrideC    = pInYuv[0]->getStride(COMPONENT_Cb);
     1096  Pel*  piDstU          = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr);
     1097  Pel*  piDstV          = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr);
     1098  UInt  uiDstStrideC    = pOutYuv->getStride(COMPONENT_Cb);
    10911099  UInt  uiWidthC        = uiWidth >> 1;
    10921100  UInt  uiHeightC       = uiHeight >> 1;
     
    11341142        if (l!=r)
    11351143        {
    1136           filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
    1137           filSrcV = ClipC( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
     1144          filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY);
     1145          filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY);
    11381146        }
    11391147        else
     
    11671175        if (t!=b)
    11681176        {
    1169           filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));
    1170           filSrcV = ClipC( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));
     1177          filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY);
     1178          filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY);
    11711179        }
    11721180        else
Note: See TracChangeset for help on using the changeset viewer.