Changeset 519 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source


Ignore:
Timestamp:
4 Jul 2013, 02:34:03 (11 years ago)
Author:
mitsubishi-htm
Message:

-intermediate version. equivalent as previous.

Location:
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp

    r518 r519  
    21892189  setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    21902190}
     2191
    21912192#endif
    21922193
     
    26322633 * \param uiCount: The next position to add merge candidate. Will be updated if VSP is successfully added
    26332634 * \param abCandIsInter: abCandIsInter[iCount] tells that VSP candidate is an Inter candidate, if VSP is successfully added
    2634  * \param pcMvFieldNeighbours:   Return the "disparity vector". Type 1 MV. To be used to fetch a depth block. A "global" variable
    2635  * \param puhInterDirNeighbours: Tells the VSP prediction direction. TODO: The value does NOT matter for VSP, as the direction will be determined based on availability later
    2636  *                                Having it as output is mainly for coding beauty
     2635 * \param pcMvFieldNeighbours:   Return combined motion information, then stored to a global buffer
     2636 *                                    1) the "disparity vector". Type 1 MV. To be used to fetch a depth block.
     2637 *                                    2) the ref index /list.    Type 2 reference picture pointer, typically for texture
     2638 * \param puhInterDirNeighbours: Indicate the VSP prediction direction.
    26372639 * \param vspFlag: vspFlag[iCount] will be set (equal to 1), if VSP is successfully added. To be used to indicate the actual position of the VSP candidate
    26382640 *
     
    26542656    return false;
    26552657 
    2656   //////////
    2657   // Code if simply re-writing
    2658 //  if(ucVspMergePos == H_3D_VSPPOSITION && picDepth != NULL && 0 != m_pcSlice->getViewIndex() ) // VSP can be used only when depth is used as input
    2659 //  {
    2660 //    abCandIsInter[iCount] = true;
    2661 //    puhInterDirNeighbours[iCount] = 1;
    2662 //    vspFlag[iCount] = 1;
    2663 //    vspDirTrue[iCount] = 0; // TODO: Check if this is really useful!!!!
    2664 //
    2665 //    Int iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC() == getSlice()->getPOC() ? 0 :
    2666 //                      (getSlice()->getAlterRefIdx(REF_PIC_LIST_0) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_0));
    2667 //    pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList0 );
    2668 //    if (getSlice()->isInterB())
    2669 //    {
    2670 //      puhInterDirNeighbours[iCount] = xGetVspDirection(uiPUIdx);
    2671 //      Int iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC() == getSlice()->getPOC() ? 0 :
    2672 //                        (getSlice()->getAlterRefIdx(REF_PIC_LIST_1) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_1));
    2673 //      pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList1 );
    2674 //    }
    2675 //
    2676 //    if ( mrgCandIdx == iCount )
    2677 //      return true;
    2678 //
    2679 //    iCount++;
    2680 //  }
    2681   /////////////
    2682  
    2683  
    26842658  Bool refViewAvailFlag = false;
    26852659  UChar predFlag[2] = {0, 0};
     
    27112685    {
    27122686      TComPic* refPic = m_pcSlice->getRefPic(eRefPicList, i);
    2713       if ( refPic->getPOC() == m_pcSlice->getPOC() ) // is inter-view reference
     2687      if ( refPic->getPOC() == m_pcSlice->getPOC() ) // inter-view reference
    27142688      {
    27152689        Int viewIdxRefInList = refPic->getViewIndex();
     
    27362710  return false;
    27372711}
     2712
    27382713#endif
    27392714
     
    47264701            estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv );
    47274702
    4728 #if 0 // H_3D_VSP
    4729           Int refFrmIdx = 0;
    4730           RefPicList privateRefPicList = REF_PIC_LIST_0;
    4731           //getRefListAndRefFrmIdx(iTargetViewIdx, privateRefPicList, refFrmIdx);
    4732 
    4733           //pDInfo->m_aListIdx[ pDInfo->iN ]  = privateRefPicList;
    4734           //pDInfo->m_aRefIdx [ pDInfo->iN ]  = -1-refFrmIdx;
    4735           assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0);
    4736 #endif //H_3D_VSP
    47374703          pDInfo->m_acDoNBDV  = cColMv;
    47384704#endif //H_3D_NBDV_REF
     
    48444810#endif
    48454811          pDInfo->m_acDoNBDV = cDispVec;
    4846          
    4847 #if 0 // H_3D_VSP
    4848           Int refFrmIdx = 0;
    4849           RefPicList privateRefPicList = REF_PIC_LIST_0 ;
    4850           getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view
    4851 
    4852           pDInfo->m_aListIdx[ pDInfo->iN ]  = privateRefPicList;
    4853           pDInfo->m_aRefIdx [ pDInfo->iN ]  = -1-refFrmIdx;
    4854           assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0);
    4855 #endif //H_3D_VSP
    4856          
    48574812#endif
    48584813          return true;
     
    48754830  }
    48764831  pDInfo->m_acDoNBDV = defaultDV;
    4877 
    4878 #if 0 // H_3D_VSP
    4879   Int refFrmIdx = 0;
    4880   RefPicList privateRefPicList = REF_PIC_LIST_0 ;
    4881   getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view
    4882 
    4883   pDInfo->m_aListIdx[ pDInfo->iN ]  = privateRefPicList;
    4884   pDInfo->m_aRefIdx [ pDInfo->iN ]  = -1-refFrmIdx;
    4885   assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0);
    4886 #endif
    4887 #endif
     4832#endif
     4833
    48884834  return false;
    48894835}
     
    49684914          if (picDepth && bDepthRefine)
    49694915            estimateDVFromDM(refViewIdx, uiPartIdx, picDepth, uiPartAddr, &cMvPred );
    4970 
    4971 #if 0 // H_3D_VSP
    4972           pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = eRefPicList;
    4973           pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refId;
    4974           assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0);
    4975 #endif
    49764916
    49774917          pNbDvInfo->m_acDoNBDV = cMvPred;
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.h

    r510 r519  
    564564                                            , Int mrgCandIdx = -1 );
    565565#if H_3D_VSP
    566   Char*         getVSPFlag        ()                        { return m_piVSPFlag;        }
    567   Char          getVSPFlag        ( UInt uiIdx )            { return m_piVSPFlag[uiIdx]; }
    568   Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;    }
     566  Char*         getVSPFlag        ()                        { return m_piVSPFlag;          }
     567  Char          getVSPFlag        ( UInt uiIdx )            { return m_piVSPFlag[uiIdx];   }
     568  Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
    569569  Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    570570#endif
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.cpp

    r512 r519  
    437437  Int         iHeight;
    438438  UInt        uiPartAddr;
    439 #if H_3D_VSP
    440   UInt        uiAbsPartIdx = pcCU->getZorderIdxInCU();
    441 #endif
    442439
    443440  if ( iPartIdx >= 0 )
     
    479476    {
    480477      if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    481         xPredInterUniVSP( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
     478        xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
    482479      else
    483         xPredInterBiVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, pcYuvPred );
     480        xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    484481    }
    485482#endif
     
    526523    {
    527524      if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    528         xPredInterUniVSP( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
     525        xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );
    529526      else
    530         xPredInterBiVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, pcYuvPred );
     527        xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    531528    }
    532529#endif
     
    573570
    574571#if H_3D_VSP
    575 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    576 {
     572Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
     573{
     574  UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();
     575
    577576  // Step 1: get depth reference
    578577  Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
     
    592591  Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
    593592  Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
     593  assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
    594594
    595595  // Step 4: Do compensation
    596   TComMv cMv  = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cMv is the disparity vector derived from the neighbors
    597   pcCU->clipMv(cMv);
     596  TComMv cDv  = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cDv is the disparity vector derived from the neighbors
     597  pcCU->clipMv(cDv);
    598598  Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
    599599  Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
    600   xPredInterLumaBlkFromDM  ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cMv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,    pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
    601   xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
     600  xPredInterLumaBlkFromDM  ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,    pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
     601  xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
    602602}
    603603#endif
     
    748748#if H_3D_VSP
    749749
    750 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred )
     750Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred )
    751751{
    752752  TComYuv* pcMbYuv;
     
    765765    pcMbYuv = &m_acYuvPred[iRefList];
    766766    if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 )
    767       xPredInterUniVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, true );
     767      xPredInterUniVSP ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true );
    768768    else
    769       xPredInterUniVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv );
     769      xPredInterUniVSP ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv );
    770770  }
    771771
     
    13901390// sizeX, sizeY: PU size
    13911391// partAddr: z-order index
    1392 // mv: disparity vector. derived from neighboring blocks
     1392// dv: disparity vector. derived from neighboring blocks
    13931393//
    13941394// Output: dstPic, PU predictor 64x64
    1395 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr,Int posX, Int posY
     1395Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY
    13961396                                            , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi )
    13971397{
     
    14261426  Int dstStride = dstPic->getStride();
    14271427  Int depStride =  pPicBaseDepth->getStride();
    1428   Int depthPosX = Clip3(0,   widthLuma - sizeX,  (posX/nTxtPerDepthX) + ((mv->getHor()+2)>>2));
    1429   Int depthPosY = Clip3(0,   heightLuma- sizeY,  (posY/nTxtPerDepthY) + ((mv->getVer()+2)>>2));
     1428  Int depthPosX = Clip3(0,   widthLuma - sizeX,  (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2));
     1429  Int depthPosY = Clip3(0,   heightLuma- sizeY,  (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2));
    14301430  Pel *ref    = refPic->getLumaAddr() + posX + posY * refStride;
    14311431  Pel *dst    = dstPic->getLumaAddr(partAddr);
     
    15951595}
    15961596
    1597 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*mv, UInt partAddr, Int posX, Int posY
     1597Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY
    15981598                                               , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi)
    15991599{
     
    16291629    nTxtPerDepthX = widthChroma / widthDepth;
    16301630    nDepthPerTxtX = 1;
    1631     depthPosX = posX / nTxtPerDepthX + ((mv->getHor()+2)>>2);
     1631    depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2);
    16321632  }
    16331633  else
     
    16351635    nTxtPerDepthX = 1;
    16361636    nDepthPerTxtX = widthDepth / widthChroma;
    1637     depthPosX = posX * nDepthPerTxtX + ((mv->getHor()+2)>>2);
     1637    depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2);
    16381638  }
    16391639  depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX);
     
    16421642    nTxtPerDepthY = heightChroma / heightDepth;
    16431643    nDepthPerTxtY = 1;
    1644     depthPosY = posY / nTxtPerDepthY + ((mv->getVer()+2)>>2);
     1644    depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2);
    16451645  }
    16461646  else
     
    16481648    nTxtPerDepthY = 1;
    16491649    nDepthPerTxtY = heightDepth / heightChroma;
    1650     depthPosY = posY * nDepthPerTxtY + ((mv->getVer()+2)>>2);
     1650    depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2);
    16511651  }
    16521652  depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY);
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.h

    r510 r519  
    9696  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,                    Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred );
    9797#if H_3D_VSP
    98   Void xPredInterUniVSP         ( TComDataCU* pcCU,                          UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false          );
    99   Void xPredInterBiVSP          ( TComDataCU* pcCU,                          UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred );
     98  Void xPredInterUniVSP         ( TComDataCU* pcCU,                          UInt uiPartAddr,                   Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false          );
     99  Void xPredInterBiVSP          ( TComDataCU* pcCU,                          UInt uiPartAddr,                   Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred );
    100100#endif
    101101
     
    119119
    120120#if H_3D_VSP
    121   Void xPredInterLumaBlkFromDM  ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
     121  Void xPredInterLumaBlkFromDM  ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
    122122                                , TComYuv *&dstPic
    123123                                , Bool bi );
    124   Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*mv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
     124  Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth
    125125                                , TComYuv *&dstPic
    126126                                , Bool bi );
Note: See TracChangeset for help on using the changeset viewer.