Ignore:
Timestamp:
1 Nov 2012, 19:22:41 (12 years ago)
Author:
mitsubishi-htm
Message:

Initial integration of VSP into HTM 4.0.1. The version used for JCT3V-B0102 at Shanghai meeting.

  • VC9 project/solution files updated. Other Visual C++ project/solution files are not updated.
  • Linux make file updated.

TODO

  • A second release is expected to include some bug fix and improvements on the interface, e.g. to move switches from macro definition to the configuration file.
  • A third release is expected after being integrated within HTM 5.x, which is to be used for CE1.h anchor.
Location:
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/CommonDef.h

    r134 r166  
    110110#define MAX_GOP                     64          ///< max. value of hierarchical GOP size
    111111
     112#if VSP_N
     113#define MAX_NUM_REF                 5           ///< max. value of multiple reference frames
     114#define MAX_NUM_REF_LC              10          ///< max. value of combined reference frames
     115#else
    112116#define MAX_NUM_REF                 4           ///< max. value of multiple reference frames
    113117#define MAX_NUM_REF_LC              8           ///< max. value of combined reference frames
     118#endif
    114119
    115120#define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r100 r166  
    4949Int * TComDataCU::m_pcGlbArlCoeffCb = NULL;
    5050Int * TComDataCU::m_pcGlbArlCoeffCr = NULL;
     51#endif
     52
     53#if FORCE_REF_VSP==1
     54#define CHECK_ADD_YET(pcCURef,uiIdx)
     55#define SET_AOUND_MVINFO(pcCURef,uiIdx)  \
     56{\
     57  if((pcCURef)->isVspMode((uiIdx))){\
     58    pcMvFieldNeighbours[iCount<<1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_0));\
     59    if(getSlice()->isInterB()){\
     60      pcMvFieldNeighbours[(iCount<<1)+1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_1));\
     61    }\
     62  }\
     63}
     64
     65#elif FORCE_REF_VSP==2
     66#define CHECK_ADD_YET(pcCURef,uiIdx)  &&!((pcCURef)->isVspMode((uiIdx),TComMv(0,0))&&bVspMvZeroDone)
     67#define SET_AOUND_MVINFO(pcCURef,uiIdx)   if((pcCURef)->isVspMode((uiIdx),TComMv(0,0))){bVspMvZeroDone=true;}
     68
     69inline bool TComDataCU::xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
     70                                    UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx)
     71{
     72#if VSP_SLICE_HEADER
     73  if( !getSlice()->getVspFlag() ) return true;
     74#endif
     75
     76  if( ucVspMergePos == VSP_MERGE_POS )
     77  {
     78#if VSP_TEXT_ONLY
     79    if( !getSlice()->getSPS()->isDepth() )
     80#endif
     81    if( getSlice()->getSPS()->getViewId()!=0 && !bVspMvZeroDone )
     82    {
     83      Bool bSubCUCanBeSynthesized[4];
     84      Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     85      getPic()->checkSynthesisAvailability( getAddr(), getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized );
     86      if( bSubCUCanBeSynthesized[0] && bSubCUCanBeSynthesized[1] && bSubCUCanBeSynthesized[2] && bSubCUCanBeSynthesized[3] )
     87      {
     88        abCandIsInter[iCount] = true;
     89        // get Inter Dir
     90        Int iInterDir = ((getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 :
     91          (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2));
     92        puhInterDirNeighbours[iCount] = iInterDir; //pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx );
     93        // get Mv from Left
     94        pcMvFieldNeighbours[iCount<<1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_0) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     95        if ( getSlice()->isInterB() )
     96        {
     97          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_1) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     98        }
     99#if SIMP_MRG_PRUN
     100        if ( mrgCandIdx == iCount )
     101        {
     102          return false;
     103        }
     104#endif
     105        iCount ++;
     106      }
     107    }
     108  }
     109  return true;
     110}
    51111#endif
    52112
     
    34503510#endif
    34513511
     3512#if FORCE_REF_VSP==2
     3513  bool bVspMvZeroDone = false;
     3514#endif
     3515
    34523516  Int iCount = 0;
    34533517
     
    35133577#endif
    35143578
    3515   //left
     3579#if FORCE_REF_VSP==2
     3580  //===== vsp 0 =====
     3581  if ( !xAddVspSkip(0, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3582    return;
     3583#endif
     3584
     3585  //===== left =====
    35163586  UInt uiLeftPartIdx = 0;
    35173587  TComDataCU* pcCULeft = 0;
     
    35333603  if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N)))
    35343604  {
    3535   if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) )
     3605  if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
     3606#if FORCE_REF_VSP
     3607    CHECK_ADD_YET(pcCULeft, uiLeftPartIdx)
     3608#endif
     3609  )
    35363610  {
    35373611    abCandIsInter[iCount] = true;
     
    35483622    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    35493623#endif
     3624#if FORCE_REF_VSP
     3625    SET_AOUND_MVINFO(pcCULeft, uiLeftPartIdx)
     3626#endif
    35503627#if SIMP_MRG_PRUN
    35513628    if ( mrgCandIdx == iCount )
     
    35813658#endif
    35823659
    3583   // above
     3660#if FORCE_REF_VSP==2
     3661  //===== vsp 1 =====
     3662  if ( !xAddVspSkip(1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3663    return;
     3664#endif
     3665
     3666  //===== above =====
    35843667#if !SIMP_MRG_PRUN
    35853668  partSize = getPartitionSize( uiAbsPartIdx );
     
    36053688#if SIMP_MRG_PRUN
    36063689  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
     3690#if FORCE_REF_VSP
     3691    CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx)
     3692#endif
    36073693    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
    36083694    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
     
    36243710    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    36253711#endif
     3712#if FORCE_REF_VSP
     3713    SET_AOUND_MVINFO(pcCUAbove, uiAbovePartIdx)
     3714#endif
    36263715#if SIMP_MRG_PRUN
    36273716    if ( mrgCandIdx == iCount )
     
    36593748#endif
    36603749
    3661   // above right
     3750#if FORCE_REF_VSP==2
     3751  //===== vsp 2 =====
     3752  if ( !xAddVspSkip(2, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3753    return;
     3754#endif
     3755
     3756  //===== above right =====
    36623757  UInt uiAboveRightPartIdx = 0;
    36633758  TComDataCU* pcCUAboveRight = 0;
     
    36773772#endif
    36783773#if SIMP_MRG_PRUN
    3679   if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
     3774  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx )
     3775#if FORCE_REF_VSP
     3776    CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx)
     3777#endif
     3778    && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
    36803779#else
    36813780  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) )
     
    36953794    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    36963795#endif
     3796#if FORCE_REF_VSP
     3797    SET_AOUND_MVINFO(pcCUAboveRight, uiAboveRightPartIdx)
     3798#endif
    36973799#if SIMP_MRG_PRUN
    36983800    if ( mrgCandIdx == iCount )
     
    37273829#endif
    37283830
    3729   //left bottom
     3831#if FORCE_REF_VSP==2
     3832  //===== vsp 3 =====
     3833  if ( !xAddVspSkip(3, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3834    return;
     3835#endif
     3836
     3837  //===== left bottom =====
     3838#if VSP_MERGE_POS < 4
     3839#if HHI_INTER_VIEW_MOTION_PRED
     3840  if( iCount < 4 + extraMergeCand )
     3841#else
     3842  if( iCount < 4 )
     3843#endif
     3844  {
     3845#endif
    37303846  UInt uiLeftBottomPartIdx = 0;
    37313847  TComDataCU* pcCULeftBottom = 0;
     
    37453861#endif
    37463862#if SIMP_MRG_PRUN
    3747   if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
     3863  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx )
     3864#if FORCE_REF_VSP
     3865    CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx)
     3866#endif
     3867    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
    37483868#else
    37493869  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) )
     
    37633883    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    37643884#endif
     3885#if FORCE_REF_VSP
     3886    SET_AOUND_MVINFO(pcCULeftBottom, uiLeftBottomPartIdx)
     3887#endif
    37653888#if SIMP_MRG_PRUN
    37663889    if ( mrgCandIdx == iCount )
     
    37713894    iCount ++;
    37723895  }
     3896#if VSP_MERGE_POS < 4
     3897  }
     3898#endif
    37733899
    37743900#if HHI_INTER_VIEW_MOTION_PRED
     
    37953921#endif
    37963922
    3797   // above left
     3923#if FORCE_REF_VSP==2
     3924  //===== vsp 4 =====
     3925  if( iCount < 4 + extraMergeCand )
     3926  {
     3927    if ( !xAddVspSkip(4, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3928      return;
     3929  }
     3930#endif
     3931
     3932  //===== above left =====
    37983933#if HHI_INTER_VIEW_MOTION_PRED
    37993934  if( iCount < 4 + extraMergeCand )
     
    38203955#if SIMP_MRG_PRUN
    38213956    if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx )
     3957#if FORCE_REF_VSP
     3958     CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx)
     3959#endif
    38223960     && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
    38233961     && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
     
    38403978      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    38413979#endif
     3980#if FORCE_REF_VSP
     3981      SET_AOUND_MVINFO(pcCUAboveLeft, uiAboveLeftPartIdx)
     3982#endif
    38423983#if SIMP_MRG_PRUN
    38433984      if ( mrgCandIdx == iCount )
     
    38493990    }
    38503991  }
     3992
     3993#if FORCE_REF_VSP==2
     3994  //===== vsp 5 =====
     3995#if HHI_INTER_VIEW_MOTION_PRED
     3996  if( iCount < 4 + extraMergeCand )
     3997#else
     3998  if( iCount < 4 )
     3999#endif
     4000  {
     4001    if ( !xAddVspSkip(5, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     4002      return;
     4003  }
     4004#endif
    38514005
    38524006  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
     
    42684422  if( uiIter == 0 )
    42694423  {
    4270     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     4424    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     4425#if FORCE_REF_VSP==1
     4426     && !pcCorner->isVspMode( uiCornerPUIdx )
     4427#endif
     4428    )
    42714429    {
    42724430      rbValidCand = true;
     
    43034461  else
    43044462  {
    4305     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     4463    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     4464#if FORCE_REF_VSP==1
     4465     && !pcCorner->isVspMode( uiCornerPUIdx )
     4466#endif
     4467    )
    43064468    {
    43074469      rbValidCand = true;
     
    44524614#endif
    44534615  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4616#if VSP_N
     4617  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4618#endif
    44544619  {
    44554620    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    44784643
    44794644  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4645#if VSP_N
     4646  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4647#endif
    44804648  {
    44814649    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45044672#endif
    45054673  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4674#if VSP_N
     4675  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4676#endif
    45064677  {
    45074678    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45294700#endif
    45304701  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4702#if VSP_N
     4703  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4704#endif
    45314705  {
    45324706    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45574731#endif
    45584732  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4733#if VSP_N
     4734  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4735#endif
    45594736  {
    45604737    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    47684945  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    47694946
    4770   Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºí·°¿¡¼­ »ç¿ëµÈ DV¸¦ ÀúÀå
     4947  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼­ »ç¿EÈ DV¸¦ ÀúÀE
    47714948  Bool  abDvMcpFlag  [2][7] = {{false,},{false,}};
    47724949  //Int   aiRefPOC     [2][7] = {{-1,},{-1}}; // debug
     
    47884965  UInt uiLeftPartIdx = uiIdx;
    47894966  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4967#if VSP_N
     4968  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4969#endif
    47904970  {
    47914971    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    48265006
    48275007  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5008#if VSP_N
     5009  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5010#endif
    48285011  {
    48295012    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    48635046#endif
    48645047  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     5048#if VSP_N
     5049  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5050#endif
    48655051  {
    48665052    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    49005086#endif
    49015087  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5088#if VSP_N
     5089  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5090#endif
    49025091  {
    49035092    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    49395128#endif
    49405129  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5130#if VSP_N
     5131  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5132#endif
    49415133  {
    49425134    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    55515743}
    55525744
     5745#if FORCE_REF_VSP==2
     5746Int TComDataCU::isVspMode ( UInt uiPartIdx )
     5747{
     5748  if( m_pePredMode[ uiPartIdx ] == MODE_SKIP  ) return 0;
     5749  if( m_pePredMode[ uiPartIdx ] == MODE_INTRA ) return 0;
     5750
     5751  Int aiRefIdx[2] = {NOT_VALID, NOT_VALID}, iRet = 0;
     5752  for( Int iList = 0; iList < 2; iList++ )
     5753  {
     5754    aiRefIdx[iList] = getCUMvField( RefPicList(iList) )->getRefIdx( uiPartIdx );
     5755    if( aiRefIdx[iList] >= 0 && getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP )
     5756    {
     5757      iRet |= (iList ? 0x02 : 0x01); // L0=1, L1=2, BI=3
     5758      continue;
     5759    }
     5760  }
     5761
     5762  return iRet;
     5763}
     5764
     5765Int TComDataCU::isVspMode ( UInt uiPartIdx, TComMv cCompMv )
     5766{
     5767  TComMv cMv;
     5768  Int iRet = 0, iList = 0;
     5769
     5770  if( (iList = isVspMode( uiPartIdx )) )
     5771  {
     5772    switch( iList )
     5773    {
     5774    case 1:
     5775      cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx );
     5776      if( cMv == cCompMv )
     5777      {
     5778        iRet = 1; // L0=1
     5779      }
     5780      break;
     5781    case 2:
     5782      cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx );
     5783      if( cMv == cCompMv )
     5784      {
     5785        iRet = 2; // L1=2
     5786      }
     5787      break;
     5788    case 3:
     5789      cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx );
     5790      if( cMv == cCompMv )
     5791      {
     5792        cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx );
     5793        if( cMv == cCompMv )
     5794        {
     5795          iRet = 3; // BI=3
     5796        }
     5797      }
     5798      break;
     5799    }
     5800  }
     5801
     5802  return iRet;
     5803}
     5804#endif
     5805
    55535806// ====================================================================================================================
    55545807// Protected member functions
     
    56125865  }
    56135866 
     5867#if AMVP_VSP_UNAVAILABLE
     5868  if( pcTmpCU != NULL && pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     5869  {
     5870    return false;
     5871  }
     5872#endif
     5873
    56145874  if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) )
    56155875  {
     
    57135973  TComDataCU* pcTmpCU = NULL;
    57145974  UInt uiIdx;
     5975#if VSP_N
     5976  Bool bRefVsp = false;
     5977#endif
    57155978  switch( eDir )
    57165979  {
     
    57706033    return false;
    57716034  }
     6035
     6036#if AMVP_VSP_UNAVAILABLE
     6037  if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6038  {
     6039    return false;
     6040  }
     6041#endif
    57726042 
    57736043  RefPicList eRefPicList2nd = REF_PIC_LIST_0;
     
    58156085    }
    58166086
     6087#if VSP_N
     6088    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6089    {
     6090      bRefVsp = true;
     6091    }
     6092    Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6093#else
    58176094    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6095#endif
    58186096    if ( iScale == 4096 )
    58196097    {
     
    58426120    }
    58436121
     6122#if VSP_N
     6123    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6124    {
     6125      bRefVsp = true;
     6126    }
     6127    Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6128#else
    58446129    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6130#endif
    58456131    if ( iScale == 4096 )
    58466132    {
     
    58756161  Int iColViewIdx, iColRefViewIdx;
    58766162  TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx);
     6163#if VSP_MV_ZERO // shimizu
    58776164  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    58786165  iColViewIdx = pColCU->getSlice()->getViewId();
    5879 
     6166#if VSP_N
     6167  if( iColViewIdx == NUM_VIEW_VSP )
     6168  {
     6169    return false;
     6170  }
     6171#endif
     6172#else 
     6173#if VSP_N
     6174  if( pColPic->getSlice(0)->getViewId() == NUM_VIEW_VSP )
     6175  {
     6176    return false;
     6177  }
     6178#endif
     6179  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
     6180  iColViewIdx = pColCU->getSlice()->getViewId();
     6181#endif
    58806182
    58816183  if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr))
     
    59046206
    59056207    iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewId();
     6208#if VSP_N
     6209    if( iColRefViewIdx == NUM_VIEW_VSP )
     6210    {
     6211      continue;
     6212    }
     6213#endif
    59066214
    59076215    if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
     
    60406348  iScale = 0;
    60416349  iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
     6350#if VSP_N
     6351//  UInt uiColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId();
     6352  UInt uiCurRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId();
     6353  if( uiCurRefViewId == NUM_VIEW_VSP )
     6354    iScale = 4096;
     6355  else
     6356#endif
    60426357  if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))
    60436358    iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    60526367  if ( iScale == 4096 )
    60536368  {
     6369#if VSP_MV_ZERO
     6370    if( uiCurRefViewId == NUM_VIEW_VSP )
     6371      rcMv.setZero();
     6372    else
     6373#endif
    60546374    rcMv = cColMv;
    60556375  }
     
    61516471    return false;
    61526472  }
     6473
     6474#if VSP_N //??
     6475  if (pColCU->isSkipped(uiPartIdxCenter))
     6476    return false;
     6477#endif
    61536478 
    61546479  if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() )
     
    77058030
    77068031//! \}
     8032
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.h

    r100 r166  
    265265  Bool          xAddMVPCand           ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    266266  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
     267#if FORCE_REF_VSP==2
     268  inline bool   xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
     269                            UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx);
     270#endif
    267271
    268272  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
     
    656660  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    657661  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
     662#if FORCE_REF_VSP==1
     663  Int           isVspMode ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; }
     664#elif FORCE_REF_VSP==2
     665  Int           isVspMode ( UInt uiPartIdx );
     666  Int           isVspMode ( UInt uiPartIdx, TComMv cCompMv );
     667#endif
    658668 
    659669  // -------------------------------------------------------------------------------------------------------------------
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r100 r166  
    562562  m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 )  );
    563563}
     564
     565#if VSP_N
     566Void
     567TComDepthMapGenerator::clearDepthMap( TComPic* pcPic, Int iVal/*=PDM_UNDEFINED_DEPTH*/ )
     568{
     569  xClearDepthMap( pcPic, iVal );
     570}
     571#endif
    564572#endif
    565573
     
    733741      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicList );
    734742      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    735 {
     743      {
     744#if VSP_N
     745        if( pcSlice->getRefViewId( eRefPicList, iPdmRefIdx ) != NUM_VIEW_VSP )
     746#endif
    736747        if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
    737748        {
     
    834845  Int           iRefPoc     = pcRefPic->getPOC();
    835846  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
     847#if VSP_N
     848  Bool          bVsp        = ( pcRefPic->getViewId() == NUM_VIEW_VSP );
     849  AOT(  bInterview &&  bVsp && iRefPoc != pcSlice->getPOC() );
     850  AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() );
     851#else
    836852  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    837853  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
     854#endif
     855
     856#if FORCE_REF_VSP
     857  if( bVsp ) return false;
     858#endif
     859
    838860  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
    839861  Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
     
    924946  Int           iRefPoc     = pcRefPic->getPOC();
    925947  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
     948#if VSP_N
     949  Bool          bVsp        = ( pcRefPic->getViewId() == NUM_VIEW_VSP );
     950  AOT(  bInterview &&  bVsp && iRefPoc != pcSlice->getPOC() );
     951  AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() );
     952#else
    926953  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    927954  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
     955#endif
     956
     957#if FORCE_REF_VSP
     958  if( bVsp ) return false;
     959#endif
    928960
    929961  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
     
    13511383    xInterPredictCUDepthMap( pcSubCU, pcSubDM );
    13521384    break;
     1385#if FORCE_REF_VSP==1
     1386  case MODE_SYNTH:
     1387    xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); //What to do? Need Fix!
     1388    break;
     1389#endif
    13531390  default:
    13541391    AOT( true );
     
    14641501                                          aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getSPS()->getViewId() != m_uiCurrViewId };
    14651502    Bool            bUsesInterViewPrd = ( abCurrIntView[0] || abCurrIntView[1] );
     1503#if VSP_N
     1504    if(( aiCurrRefIdx[0] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_0, aiCurrRefIdx[0] )->getViewId() == NUM_VIEW_VSP ) ||
     1505       ( aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getViewId() == NUM_VIEW_VSP )) {
     1506      //if refpic is VSP, copy to Original cuurent PDM
     1507      TComPicYuv* pcPdm = pcCU->getPic()->getPredDepthMap();
     1508      UInt  uiZOrderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1509      assert( pcPdm );
     1510      pcCUDepthMap->copyFromPicYuv( pcPdm, pcCU->getAddr(), uiZOrderIdx );
     1511    }
     1512#endif
    14661513    if( bUsesInterViewPrd )
    14671514    {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r100 r166  
    140140  Void  updateDepthMap        ( TComPic*      pcPic );
    141141  Void  dumpDepthMap          ( TComPic*      pcPic, char* pFilenameBase );
     142#if VSP_N
     143  Void  clearDepthMap         ( TComPic*      pcPic, Int   iVal  = PDM_UNDEFINED_DEPTH);
     144#endif
    142145#endif
    143146
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComLoopFilter.cpp

    r56 r166  
    439439 
    440440  //-- Set BS for Intra MB : BS = 4 or 3
    441   if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) )
     441  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ)
     442#if FORCE_REF_VSP==1
     443    || pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ)
     444#endif
     445  )
    442446  {
    443447    uiBs = 2;
     
    445449 
    446450  //-- Set BS for not Intra MB : BS = 2 or 1 or 0
    447   if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) )
     451  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ)
     452#if FORCE_REF_VSP==1
     453    && !pcCUP->isVspMode(uiPartP) && !pcCUQ->isVspMode(uiPartQ)
     454#endif
     455  )
    448456  {
    449457#if NSQT_LFFIX
     
    542550  }   // enf of "if( not Intra )"
    543551 
     552#if FORCE_REF_VSP==1
     553  if ( pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ))
     554  {
     555    uiBs = 0;
     556  }
     557#endif
     558
    544559  m_aapucBS[iDir][uiAbsPartIdx] = uiBs;
    545560}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.cpp

    r100 r166  
    5353  m_apcPicYuv[0]      = NULL;
    5454  m_apcPicYuv[1]      = NULL;
     55#if VSP_N
     56  m_apcPicYuvAvail     = NULL;
     57  m_apcPicYuvSynth     = NULL;
     58#endif
    5559#if DEPTH_MAP_GENERATION
    5660  m_pcPredDepthMap    = NULL;
     
    6468#if HHI_INTER_VIEW_RESIDUAL_PRED
    6569  m_pcResidual        = NULL;
     70#endif
     71#if DEBUGIMGOUT
     72  m_acPicYuvDebug     = NULL;
    6673#endif
    6774  m_pcPicYuvPred      = NULL;
     
    95102  }
    96103  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    97  
     104#if DEBUGIMGOUT
     105  m_acPicYuvDebug    = new TComPicYuv;  m_acPicYuvDebug->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     106#endif
     107
    98108  /* there are no SEI messages associated with this picture initially */
    99109  m_SEIs = NULL;
     
    162172    delete m_pcResidual;
    163173    m_pcResidual = NULL;
     174  }
     175#endif
     176#if DEBUGIMGOUT
     177  if (m_acPicYuvDebug)
     178  {
     179    m_acPicYuvDebug->destroy();
     180    delete m_acPicYuvDebug;
     181    m_acPicYuvDebug = NULL;
    164182  }
    165183#endif
     
    623641}
    624642
     643#if VSP_N
     644Void TComPic::checkSynthesisAvailability( /*TComDataCU*& rpcCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied )
     645{
     646  rpbCUSynthesied[0] = true;
     647  rpbCUSynthesied[1] = true;
     648  rpbCUSynthesied[2] = true;
     649  rpbCUSynthesied[3] = true;
     650
     651  if (!getPicYuvAvail())
     652  {
     653    rpbCUSynthesied[0] = false;
     654    rpbCUSynthesied[1] = false;
     655    rpbCUSynthesied[2] = false;
     656    rpbCUSynthesied[3] = false;
     657    return;   
     658  }
     659 
     660  Int x, y;
     661  Pel* pAvail  = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx );
     662  Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx);
     663  Int CUWidth  = g_uiMaxCUWidth  >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx);
     664 
     665  Int  iStride  = getPicYuvAvail()->getStride();
     666  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- )
     667  {
     668    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     669    {
     670      rpbCUSynthesied[0] &= (pAvail[x] != 0);
     671    }
     672    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     673    {
     674      rpbCUSynthesied[1] &= (pAvail[x] != 0);
     675    }
     676    pAvail += iStride;
     677  }
     678  //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- )
     679  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka
     680  {
     681    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     682    {
     683      rpbCUSynthesied[2] &= (pAvail[x] != 0);
     684    }
     685    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     686    {
     687      rpbCUSynthesied[3] &= (pAvail[x] != 0);
     688    }
     689    pAvail += iStride;
     690  }
     691
     692  //rpbCUSynthesied[0] = !rpbCUSynthesied[0];
     693  //rpbCUSynthesied[1] = !rpbCUSynthesied[1];
     694  //rpbCUSynthesied[2] = !rpbCUSynthesied[2];
     695  //rpbCUSynthesied[3] = !rpbCUSynthesied[3];
     696}
     697#endif
    625698
    626699//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h

    r100 r166  
    6565  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
    6666 
     67#if VSP_N
     68  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
     69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
     70#endif
     71
    6772#if DEPTH_MAP_GENERATION
    6873  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
     
    8590#if HHI_INTER_VIEW_RESIDUAL_PRED
    8691  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
     92#endif
     93#if DEBUGIMGOUT
     94  TComPicYuv*           m_acPicYuvDebug;          //  debug image
    8795#endif
    8896
     
    145153  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
    146154  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
     155#if VSP_N
     156  Void          setPicYuvAvail( TComPicYuv* pc ){ m_apcPicYuvAvail = pc; }
     157  Void          setPicYuvSynth( TComPicYuv* pc ){ m_apcPicYuvSynth = pc; }
     158  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; }
     159  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; }
     160  Void          checkSynthesisAvailability(  /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
     161#endif
    147162#if HHI_INTERVIEW_SKIP
    148163  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
     
    168183#if HHI_INTER_VIEW_RESIDUAL_PRED
    169184  TComPicYuv*   getResidual()         { return  m_pcResidual; }
     185#endif
     186
     187#if DEBUGIMGOUT
     188  TComPicYuv*   getPicYuvRecDbg()     { return  m_acPicYuvDebug; }
    170189#endif
    171190
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicSym.cpp

    r56 r166  
    9797    m_puiInverseCUOrderMap[i] = i;
    9898  }
     99
     100#if VSP_N
     101  m_apcTComTile = NULL;
     102#endif
    99103}
    100104
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicYuv.h

    r56 r166  
    184184  Void  setChromaTo  ( Pel pVal ); 
    185185
     186#if DEBUGIMGOUT
     187  // Degub tools
     188public:
     189  Void colsetToPicYuv   ( const UChar ucColor[3],                 Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     190  Void colsetToPicLuma  ( const UChar ucLumaOffCol,               Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     191  Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     192  Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize,      TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     193#endif
     194
    186195};// END CLASS DEFINITION TComPicYuv
    187196
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.h

    r100 r166  
    9595  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset );
    9696#endif
    97 
    9897#if DEPTH_MAP_GENERATION
    9998  Void xWeightedAveragePdm      ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY );
     
    103102  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    104103  Void xWeightedAverage         ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
    105  
     104
    106105  Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
    107106
     
    142141  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    143142#endif
    144  
     143
    145144  // motion vector prediction
    146145  Void getMvPredAMVP              ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r100 r166  
    390390    xSetRecResidualInterCU( pcSubCU, pcSubRes );
    391391    break;
     392#if FORCE_REF_VSP==1
     393  case MODE_SYNTH:
     394    xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function
     395    break;
     396#endif
    392397  default:
    393398    AOT( true );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r101 r166  
    114114{
    115115  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
     116
     117#if FORCE_REF_VSP
     118  m_iRefIdxVsp[0] = m_iRefIdxVsp[1] = NOT_VALID;
     119#endif
    116120 
    117121  initEqualRef();
     
    139143  resetWpScalingLC(m_weightPredTableLC);
    140144  initWpAcDcParam();
     145
     146#if VSP_SLICE_HEADER
     147  m_bVspFlag = false;
     148#endif
    141149}
    142150
     
    185193  m_numEntryPointOffsets = 0;
    186194#endif
     195#if VSP_SLICE_HEADER
     196  m_bVspFlag = false;
     197#endif
     198
    187199}
    188200
     
    407419}
    408420
     421#if VSP_N
     422Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic )
     423#else
    409424Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics )
     425#endif
    410426{
    411427  if( m_eSliceType == I_SLICE )
     
    422438  TComPic*  RefPicSetLtCurr [16];
    423439  TComPic*  RefPicSetIvCurr [16];
     440#if VSP_N
     441  TComPic*  RefPicSetVspCurr [16] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; //for Linux comp
     442#endif
    424443
    425444  UInt NumPocStCurr0 = 0;
     
    427446  UInt NumPocLtCurr  = 0;
    428447  UInt NumPocIvCurr  = 0;
     448#if VSP_N
     449  UInt NumPocVspCurr  = 0;
     450#endif
    429451
    430452  Int i;
     
    474496    NumPocIvCurr++;
    475497  }
     498#if VSP_N
     499  if( pcVspPic )
     500  {
     501    pcRefPic = pcVspPic;
     502    pcRefPic->setIsLongTerm( 0 );
     503    pcRefPic->getPicYuvRec()->extendPicBorder();
     504    RefPicSetVspCurr[NumPocVspCurr] = pcRefPic;
     505    NumPocVspCurr++;
     506  }
     507#endif
    476508
    477509  // ref_pic_list_init
     
    481513
    482514  assert( (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) == getNumPocTotalCurrMvc() );
     515#if VSP_N
     516  Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) );
     517  Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) );
     518#else
    483519  Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) );
    484520  Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) );
     521#endif
    485522
    486523  assert( numRpsCurrTempList0 <= 16 );
     
    509546  for( cIdx = 0; cIdx <= num_ref_idx_l0_active_minus1; cIdx ++ )
    510547  {
     548#if VSP_N
     549    if( pcVspPic && cIdx == num_ref_idx_l0_active_minus1 )
     550    {
     551      m_apcRefPicList[0][cIdx] = RefPicSetVspCurr[0];
     552#if FORCE_REF_VSP
     553      m_iRefIdxVsp[0] = cIdx;
     554#endif
     555    }
     556    else
     557      m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
     558#else
    511559    m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
     560#endif
    512561  }
    513562  if( m_eSliceType == P_SLICE )
     
    520569    for( cIdx = 0; cIdx <= num_ref_idx_l1_active_minus1; cIdx ++ )
    521570    {
     571#if VSP_N
     572      if( pcVspPic && cIdx == num_ref_idx_l1_active_minus1 )
     573      {
     574        m_apcRefPicList[1][cIdx] = RefPicSetVspCurr[0];
     575#if FORCE_REF_VSP
     576        m_iRefIdxVsp[1] = cIdx;
     577#endif
     578      }
     579      else
     580        m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
     581#else
    522582      m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
     583#endif
    523584    }
    524585  }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.h

    r101 r166  
    4545#include "TComRom.h"
    4646#include "TComList.h"
    47 
    4847//! \ingroup TLibCommon
    4948//! \{
     
    12691268
    12701269#if SONY_COLPIC_AVAILABILITY
    1271   Int         m_iViewOrderIdx;
     1270  Int        m_iViewOrderIdx;
     1271#endif
     1272
     1273#if FORCE_REF_VSP
     1274  Int        m_iRefIdxVsp[2]; // L0/L1
     1275#endif
     1276
     1277#if VSP_SLICE_HEADER
     1278  Bool      m_bVspFlag;
    12721279#endif
    12731280
     
    14111418  Int       getNumPocTotalCurr();
    14121419  Int       getNumPocTotalCurrMvc();
     1420#if VSP_N
     1421  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic );
     1422#else
    14131423  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics );
     1424#endif
    14141425  Void      setRefPOCnViewListsMvc();
    14151426
     
    15651576  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
    15661577
     1578#if FORCE_REF_VSP
     1579  Void      setRefIdxVsp ( Int idx, Int refList ) { m_iRefIdxVsp[refList] = idx; }
     1580  Int       getRefIdxVsp ( Int refList )          { return m_iRefIdxVsp[refList]; }
     1581#endif
     1582
     1583#if VSP_SLICE_HEADER
     1584  Void      setVspFlag          ( Bool val )    { m_bVspFlag = val; }
     1585  Bool      getVspFlag          ()              { return m_bVspFlag; }
     1586#endif
     1587
    15671588protected:
    15681589  TComPic*  xGetRefPic        (TComList<TComPic*>& rcListPic, UInt uiPOC);
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComYuv.h

    r100 r166  
    213213
    214214  __inline Pel  xClip  (Pel x )      { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); }
     215
     216#if DEBUGIMGOUT
     217public:
     218  Void colsetToPicYuv   ( const UChar ucColor[3],                 Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     219  Void colsetToPicLuma  ( const UChar ucLumaOffCol,               Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     220  Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     221  Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize,      TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     222#endif
     223
    215224};// END CLASS DEFINITION TComYuv
    216225
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TypeDef.h

    r133 r166  
    4242//! \{
    4343
     44#define VSP_N                             1
     45#if VSP_N
     46#define VSP_TEXT_ONLY                     1
     47#define NUM_VIEW_VSP                      99
     48#define VSP_N_DUMP                        0
     49#define FORCE_REF_VSP                     2   // 0=NotUseVSPSKIP 1:VSPSKIPforFlag 2:VSPSKIPforMergeIdx
     50#define VSP_MV_ZERO                       0   // use zero vector for VSP
     51#if VSP_MV_ZERO
     52#define AMVP_VSP_UNAVAILABLE              1
     53#endif
     54#define VSP_MERGE_POS                     5   // position of vsp in merge list (0..5)
     55#define NTT_SUBPEL                        1
     56#endif
     57#define DEBUGIMGOUT                       0   //Debug YUVImage Out
     58#define DEBUGLOGOUT                       0   //Debug Log Out
     59
     60#define VSP_SLICE_HEADER                  1
     61#define VSP_FRAME_INTERVAL                2
     62
    4463#define FIXES                             1
    4564#define POZNAN_CABAC_INIT_FLAG_FIX        1
     
    115134#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
    116135                                       
    117 #if HHI_INTER_VIEW_MOTION_PRED         
     136#if HHI_INTER_VIEW_MOTION_PRED
    118137#define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
    119138#else                                 
     
    727746  MODE_INTER,           ///< inter-prediction mode
    728747  MODE_INTRA,           ///< intra-prediction mode
     748#if FORCE_REF_VSP==1
     749  MODE_SYNTH,           ///< synth-mode
     750#endif
    729751  MODE_NONE = 15
    730752};
Note: See TracChangeset for help on using the changeset viewer.