Changeset 55 in SHVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp


Ignore:
Timestamp:
4 Mar 2013, 22:43:28 (12 years ago)
Author:
seregin
Message:

Reintegrate SHM-1.1-dev branch into the trunk

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source

  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r33 r55  
    383383  m_layerId          = pcPic->getLayerId();
    384384#endif
    385 
    386385  for(int i=0; i<pcPic->getNumPartInCU(); i++)
    387386  {
     
    29062905  if(m_layerId) 
    29072906  {
     2907#if MV_SCALING_POS_FIX
     2908    pcColCU = getBaseColCU( xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase );
     2909#else
    29082910    UInt uiPartIdxCenter;
    29092911    xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter );
    29102912    uiPartIdxCenter -= m_uiAbsIdxInLCU;
    29112913    pcColCU = getBaseColCU( uiPartIdxCenter, uiCUAddrBase, uiAbsPartAddrBase );
     2914#endif
    29122915   
    29132916#if INTRA_BL
     
    48434846}
    48444847
    4845 #if INTRA_BL
     4848#if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    48464849Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride )
    48474850{
     
    48834886TComDataCU*  TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
    48844887{
     4888#if 1 // it should provide identical resutls
     4889  UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
     4890  UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
     4891
     4892  return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );
     4893#else
    48854894  TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
    48864895
     
    49274936
    49284937  return cBaseColPic->getCU(uiCUAddrBase);
     4938#endif
     4939}
     4940
     4941TComDataCU*  TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     4942{
     4943  TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
     4944
     4945#if SVC_UPSAMPLING
     4946  Int iBWidth   = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset();
     4947  Int iBHeight  = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset();
     4948
     4949  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
     4950  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
     4951#else
     4952  Int iBWidth   = cBaseColPic->getPicYuvRec()->getWidth();
     4953  Int iBHeight  = cBaseColPic->getPicYuvRec()->getHeight();
     4954
     4955  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
     4956  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
     4957#endif
     4958
     4959  uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX);
     4960  uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY);
     4961
     4962  UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
     4963
     4964  Int iBX = (uiPelX*iBWidth + iEWidth/2)/iEWidth;
     4965  Int iBY = (uiPelY*iBHeight+ iEHeight/2)/iEHeight;
     4966
     4967  if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight())
     4968  {
     4969    return NULL;
     4970  }
     4971
     4972#if AVC_SYNTAX
     4973  if( iBX >= iBWidth || iBY >= iBHeight ) //outside of the reference layer cropped picture
     4974  {
     4975    return NULL;
     4976  }
     4977#endif
     4978
     4979  uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
     4980
     4981  assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());
     4982
     4983  UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth()
     4984    + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
     4985
     4986  uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase];
     4987
     4988  return cBaseColPic->getCU(uiCUAddrBase);
    49294989}
    49304990
    49314991Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase )
    49324992{
    4933    TComMvField cMvFieldBase;
    4934    TComMv cMv;
    4935 
    4936    Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
    4937    Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
    4938 
    4939    Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
    4940    Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
    4941 
    4942    Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth;
    4943    Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight;
    4944 
    4945    cMv.set(iMvX, iMvY);
    4946 
    4947    rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
     4993  TComMvField cMvFieldBase;
     4994  TComMv cMv;
     4995
     4996#if MV_SCALING_FIX
     4997  Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset();
     4998  Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset();
     4999
     5000  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
     5001  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
     5002#else
     5003  Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     5004  Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     5005
     5006  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
     5007  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
     5008#endif
     5009
     5010  Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth;
     5011  Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight;
     5012
     5013  cMv.set(iMvX, iMvY);
     5014
     5015  rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
    49485016}
    49495017#endif
Note: See TracChangeset for help on using the changeset viewer.