Changeset 46 in SHVCSoftware for branches/SHM-1.1-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
22 Feb 2013, 20:33:00 (12 years ago)
Author:
seregin
Message:

overloaded function for getBaseColCU

Location:
branches/SHM-1.1-dev/source/Lib/TLibCommon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-1.1-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r41 r46  
    48824882TComDataCU*  TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
    48834883{
     4884#if 1 // it should provide identical resutls
     4885  UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
     4886  UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
     4887
     4888  return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );
     4889#else
    48844890  TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
    48854891
     
    49264932
    49274933  return cBaseColPic->getCU(uiCUAddrBase);
     4934#endif
     4935}
     4936
     4937TComDataCU*  TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     4938{
     4939  TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
     4940
     4941#if SVC_UPSAMPLING
     4942  Int iBWidth   = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset();
     4943  Int iBHeight  = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset();
     4944
     4945  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
     4946  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
     4947#else
     4948  Int iBWidth   = cBaseColPic->getPicYuvRec()->getWidth();
     4949  Int iBHeight  = cBaseColPic->getPicYuvRec()->getHeight();
     4950
     4951  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
     4952  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
     4953#endif
     4954
     4955  uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX);
     4956  uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY);
     4957
     4958  UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
     4959
     4960  Int iBX = (uiPelX*iBWidth + iEWidth/2)/iEWidth;
     4961  Int iBY = (uiPelY*iBHeight+ iEHeight/2)/iEHeight;
     4962
     4963  if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight())
     4964  {
     4965    return NULL;
     4966  }
     4967
     4968#if AVC_SYNTAX
     4969  if( iBX >= iBWidth || iBY >= iBHeight ) //outside of the reference layer cropped picture
     4970  {
     4971    return NULL;
     4972  }
     4973#endif
     4974
     4975  uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
     4976
     4977  assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());
     4978
     4979  UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth()
     4980    + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
     4981
     4982  uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase];
     4983
     4984  return cBaseColPic->getCU(uiCUAddrBase);
    49284985}
    49294986
    49304987Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase )
    49314988{
    4932    TComMvField cMvFieldBase;
    4933    TComMv cMv;
     4989  TComMvField cMvFieldBase;
     4990  TComMv cMv;
    49344991
    49354992#if MV_SCALING_FIX
    4936    Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset();
    4937    Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset();
    4938 
    4939    Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
    4940    Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
     4993  Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset();
     4994  Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset();
     4995
     4996  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
     4997  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
    49414998#else
    4942    Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
    4943    Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
    4944 
    4945    Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
    4946    Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
    4947 #endif
    4948 
    4949    Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth;
    4950    Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight;
    4951 
    4952    cMv.set(iMvX, iMvY);
    4953 
    4954    rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
     4999  Int iBWidth   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     5000  Int iBHeight  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     5001
     5002  Int iEWidth   = m_pcPic->getPicYuvRec()->getWidth();
     5003  Int iEHeight  = m_pcPic->getPicYuvRec()->getHeight();
     5004#endif
     5005
     5006  Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth;
     5007  Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight;
     5008
     5009  cMv.set(iMvX, iMvY);
     5010
     5011  rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
    49555012}
    49565013#endif
  • branches/SHM-1.1-dev/source/Lib/TLibCommon/TComDataCU.h

    r41 r46  
    593593#if SVC_COL_BLK
    594594  TComDataCU*   getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
     595  TComDataCU*   getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    595596  Void          scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
    596597#endif
Note: See TracChangeset for help on using the changeset viewer.