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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r133 r166  
    683683UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey,
    684684                                    TComMv baseRefMv,
    685                                     Int iFrac, TComMv& rcMvFrac )
     685                                    Int iFrac, TComMv& rcMvFrac
     686#if VSP_MV_ZERO
     687                                   ,Bool bIsVsp
     688#endif
     689                                   )
    686690{
    687691  UInt  uiDist;
     
    699703  TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ);
    700704 
     705#if VSP_MV_ZERO
     706  UInt iAround = ( bIsVsp )? 1:9;
     707  for (UInt i = 0; i < iAround; i++)
     708#else
    701709  for (UInt i = 0; i < 9; i++)
     710#endif
    702711  {
    703712    TComMv cMvTest = pcMvRefine[i];
     
    871880      {
    872881        m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     882#if FORCE_REF_VSP==1
     883        if( pcCU->getSlice()->getViewId() != 0 )
     884#if VSP_TEXT_ONLY
     885        if( !pcCU->getSlice()->getSPS()->isDepth() )
     886#endif
     887          m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     888#endif
    873889        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    874890      }
     
    27512767#if AMP_MRG
    27522768#if LG_RESTRICTEDRESPRED_M24766
    2753 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    2754 #else
    2755 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
     2769Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG
     2770#if FORCE_REF_VSP==1
     2771                                 , Bool bForceRefVsp
     2772#endif
     2773                                 )
     2774#else
     2775Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG
     2776#if FORCE_REF_VSP==1
     2777                                 , Bool bForceRefVsp
     2778#endif
     2779                                 )
    27562780#endif
    27572781#else
     
    28132837#endif
    28142838
     2839#if FORCE_REF_VSP==1
     2840  if( bForceRefVsp )
     2841  {
     2842    assert( ePartSize == SIZE_2Nx2N );
     2843
     2844    //  Clear Motion Field
     2845    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 );
     2846    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 );
     2847    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd    ( cMvZero,       ePartSize, 0, pcCU->getDepth(0), 0 );
     2848    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( cMvZero,       ePartSize, 0, pcCU->getDepth(0), 0 );
     2849
     2850    //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), ePartSize, 0, pcCU->getDepth(0), 0 );
     2851    //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), ePartSize, 0, pcCU->getDepth(0), 0 );
     2852
     2853    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0));
     2854    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0));
     2855    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0));
     2856    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0));
     2857
     2858    rpcPredYuv->copyFromPicYuv( pcCU->getPic()->getPicYuvSynth(), pcCU->getAddr(), pcCU->getZorderIdxInCU() );
     2859    setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X );
     2860
     2861    return;
     2862  }
     2863#endif
     2864
    28152865#if ZERO_MVD_EST
    28162866  Int           aiZeroMvdMvpIdx[2] = {-1, -1};
     
    28332883#if HHI_INTER_VIEW_MOTION_PRED
    28342884  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     2885#endif
     2886
     2887#if VSP_MV_ZERO
     2888  bool bIsVsp = false;
     2889  //Bool bWholeCUCanBeSynthesized = false;
     2890  //Bool bSubCUCanBeSynthesized[4];
     2891  //if( pcCU->getSlice()->getViewId() )
     2892  //{
     2893  //  Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     2894  //  pcCU->getPic()->checkSynthesisAvailability(/*rpcBestCU, */pcCU->getAddr(), pcCU->getZorderIdxInCU(), pcCU->getDepth(0), pbSubCUCanBeSynthesized); //KUBA SYNTH
     2895  //  Int  iSubCUCanBeSynthesizedCnt = 0;
     2896  //  for(Int i = 0; i < 4; i++)
     2897  //  {
     2898  //    if (bSubCUCanBeSynthesized[i])
     2899  //    {
     2900  //      iSubCUCanBeSynthesizedCnt ++;
     2901  //    }
     2902  //  }
     2903  //  if(iSubCUCanBeSynthesizedCnt == 4)
     2904  //  {
     2905  //    bWholeCUCanBeSynthesized = true;
     2906  //  }
     2907  //}
    28352908#endif
    28362909
     
    28572930    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    28582931    UInt          uiBitsTempL0[MAX_NUM_REF];
     2932
    28592933#if LG_RESTRICTEDRESPRED_M24766
    28602934    Int iPUResiPredShift[4] = {0, 0, 0, 0};
     
    28852959      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    28862960      {
     2961#if VSP_MV_ZERO
     2962        bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP);
     2963        //if( bIsVsp && !bWholeCUCanBeSynthesized )
     2964        //{
     2965        //  continue;
     2966        //}
     2967#endif
    28872968#if LG_RESTRICTEDRESPRED_M24766
    28882969        if( pcCU->getResPredFlag( 0 ))
     
    29082989          if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
    29092990        }
     2991#if VSP_MV_ZERO
     2992        if( bIsVsp )
     2993        {
     2994          aaiMvpIdx[iRefList][iRefIdxTemp] = -1;
     2995          aaiMvpNum[iRefList][iRefIdxTemp] = -1;
     2996          cMvPred[iRefList][iRefIdxTemp].setZero();
     2997        }
     2998        else
     2999        {
     3000#endif
    29103001#if H0111_MVD_L1_ZERO
    29113002#if ZERO_MVD_EST
     
    29373028#else
    29383029        uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
     3030#endif
     3031#if VSP_MV_ZERO
     3032        } // if( bIsVsp )
    29393033#endif
    29403034#if ZERO_MVD_EST
     
    29733067              else
    29743068              {
     3069#if VSP_MV_ZERO
     3070                if( pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP )
     3071                {
     3072                  cMvTemp[1][iRefIdxTemp].setZero();
     3073                  uiCostTemp = 0;
     3074                }
     3075                else
     3076                {
     3077#endif
    29753078                cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    29763079                uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    29773080                /*first subtract the bit-rate part of the cost of the other list*/
    29783081                uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );
     3082#if VSP_MV_ZERO
     3083                }
     3084#endif
    29793085              }
    29803086              /*correct the bit-rate part of the current ref*/
     
    29863092            else
    29873093            {
     3094#if VSP_MV_ZERO
     3095              xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp );
     3096#else
    29883097              xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3098#endif
    29893099            }
    29903100        }
     
    29983108          else
    29993109          {
     3110#if VSP_MV_ZERO
     3111            xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp );
     3112#else
    30003113            xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3114#endif
    30013115          }       
    30023116        }
    30033117#else
    30043118        xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3119#endif
     3120#if VSP_MV_ZERO
     3121        if( bIsVsp )
     3122        {
     3123          cMvPred[iRefList][iRefIdxTemp].setZero();
     3124        }
     3125        else
     3126        {
    30053127#endif
    30063128        xCopyAMVPInfo(pcCU->getCUMvField(eRefPicList)->getAMVPInfo(), &aacAMVPInfo[iRefList][iRefIdxTemp]); // must always be done ( also when AMVP_MODE = AM_NONE )
     
    30093131          xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    30103132        }
     3133#if VSP_MV_ZERO
     3134        }
     3135#endif
    30113136
    30123137        if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())
     
    30883213      if(pcCU->getSlice()->getMvdL1ZeroFlag())
    30893214      {
     3215#if VSP_MV_ZERO
     3216        bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, bestBiPRefIdxL1) == NUM_VIEW_VSP);
     3217
     3218        if( bIsVsp )
     3219        {
     3220          cMvPredBi[1][bestBiPRefIdxL1].setZero();
     3221        }
     3222        else
     3223        {
     3224#endif
    30903225        xCopyAMVPInfo(&aacAMVPInfo[1][bestBiPRefIdxL1], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo());
    30913226        pcCU->setMVPIdxSubParts( bestBiPMvpL1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    30923227        aaiMvpIdxBi[1][bestBiPRefIdxL1] = bestBiPMvpL1;
    30933228        cMvPredBi[1][bestBiPRefIdxL1]   = pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()->m_acMvCand[bestBiPMvpL1];
     3229#if VSP_MV_ZERO
     3230        }
     3231#endif
    30943232
    30953233        cMvBi[1] = cMvPredBi[1][bestBiPRefIdxL1];
     
    31093247        }
    31103248
     3249#if VSP_MV_ZERO
     3250        if( !bIsVsp )
     3251        {
     3252#endif
    31113253#if HHI_INTER_VIEW_MOTION_PRED
    31123254        uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands];
    31133255#else
    31143256        uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][AMVP_MAX_NUM_CANDS];
     3257#endif
     3258#if VSP_MV_ZERO
     3259        }
    31153260#endif
    31163261
     
    31683313        for ( Int iRefIdxTemp = iRefStart; iRefIdxTemp <= iRefEnd; iRefIdxTemp++ )
    31693314        {
     3315#if VSP_MV_ZERO
     3316          bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP);
     3317          //if( bIsVsp && !bWholeCUCanBeSynthesized )
     3318          //{
     3319          //  continue;
     3320          //}
     3321#endif
    31703322          uiBitsTemp = uiMbBits[2] + uiMotBits[1-iRefList];
    31713323          if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 )
     
    31743326            if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
    31753327          }
     3328#if VSP_MV_ZERO
     3329          if( !bIsVsp )
     3330          {
     3331#endif
    31763332#if HHI_INTER_VIEW_MOTION_PRED
    31773333          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands];
    31783334#else
    31793335          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
     3336#endif
     3337#if VSP_MV_ZERO
     3338          }
    31803339#endif
    31813340#if LG_RESTRICTEDRESPRED_M24766
     
    32113370#endif
    32123371          // call ME
     3372#if VSP_MV_ZERO
     3373          xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp, true );
     3374#else
    32133375          xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp, true );
     3376#endif
     3377#if VSP_MV_ZERO
     3378          if( !bIsVsp )
     3379          {
     3380#endif
    32143381          if ( pcCU->getAMVPMode(uiPartAddr) == AM_EXPL )
    32153382          {
     
    32173384            xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    32183385          }
    3219          
     3386#if VSP_MV_ZERO
     3387          }
     3388#endif
     3389
    32203390          if ( uiCostTemp < uiCostBi )
    32213391          {
     
    32493419          if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] && pcCU->getAMVPMode(uiPartAddr) == AM_EXPL )
    32503420          {
     3421#if VSP_MV_ZERO
     3422            bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP);
     3423
     3424            if( !bIsVsp )
     3425            {
     3426#endif
    32513427            xCopyAMVPInfo(&aacAMVPInfo[0][iRefIdxBi[0]], pcCU->getCUMvField(REF_PIC_LIST_0)->getAMVPInfo());
    32523428            xCheckBestMVP(pcCU, REF_PIC_LIST_0, cMvBi[0], cMvPredBi[0][iRefIdxBi[0]], aaiMvpIdxBi[0][iRefIdxBi[0]], uiBits[2], uiCostBi);
     3429#if VSP_MV_ZERO
     3430            }
     3431#endif
    32533432#if H0111_MVD_L1_ZERO
    32543433            if(!pcCU->getSlice()->getMvdL1ZeroFlag())
    32553434            {
    32563435#endif
     3436#if VSP_MV_ZERO
     3437              bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP);
     3438
     3439              if( !bIsVsp )
     3440              {
     3441#endif
    32573442              xCopyAMVPInfo(&aacAMVPInfo[1][iRefIdxBi[1]], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo());
    32583443              xCheckBestMVP(pcCU, REF_PIC_LIST_1, cMvBi[1], cMvPredBi[1][iRefIdxBi[1]], aaiMvpIdxBi[1][iRefIdxBi[1]], uiBits[2], uiCostBi);
     3444#if VSP_MV_ZERO
     3445              }
     3446#endif
    32593447#if H0111_MVD_L1_ZERO
    32603448            }
     
    34173605      pcCU->setInterDirSubParts( 3, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34183606     
     3607#if VSP_MV_ZERO
     3608      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP);
     3609      if( !bIsVsp )
     3610      {
     3611#endif
    34193612      pcCU->setMVPIdxSubParts( aaiMvpIdxBi[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34203613      pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3614#if VSP_MV_ZERO
     3615      }
     3616      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP);
     3617      if( !bIsVsp )
     3618      {
     3619#endif
    34213620      pcCU->setMVPIdxSubParts( aaiMvpIdxBi[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34223621      pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3622#if VSP_MV_ZERO
     3623      }
     3624#endif
    34233625
    34243626      uiMEBits = uiBits[2];
     
    34353637      pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34363638     
     3639#if VSP_MV_ZERO
     3640      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdx[0]) == NUM_VIEW_VSP);
     3641      if( !bIsVsp )
     3642      {
     3643#endif
    34373644      pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34383645      pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3646#if VSP_MV_ZERO
     3647      }
     3648#endif
    34393649
    34403650      uiMEBits = uiBits[0];
     
    34513661      pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34523662     
     3663#if VSP_MV_ZERO
     3664      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdx[1]) == NUM_VIEW_VSP);
     3665      if( !bIsVsp )
     3666      {
     3667#endif
    34533668      pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34543669      pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3670#if VSP_MV_ZERO
     3671      }
     3672#endif
    34553673
    34563674      uiMEBits = uiBits[1];
     
    38884106}
    38894107
     4108#if VSP_MV_ZERO
     4109Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, Bool bIsVsp, UInt& ruiBits, UInt& ruiCost, Bool bBi  )
     4110#else
    38904111Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi  )
     4112#endif
    38914113{
    38924114  UInt          uiPartAddr;
     
    39014123  m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];
    39024124 
     4125#if VSP_MV_ZERO
     4126  Int           iSrchRng      = ( bIsVsp ? 0 : ( bBi ? m_bipredSearchRange : m_iSearchRange ) );
     4127#else
    39034128  Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
     4129#endif
    39044130  TComPattern*  pcPatternKey  = pcCU->getPattern        ();
    39054131 
     
    39474173  m_pcRdCost->setCostScale  ( 2 );
    39484174
     4175#if VSP_MV_ZERO
     4176  if( !bIsVsp )
     4177#endif
    39494178#if HHI_INTER_VIEW_MOTION_PRED
    39504179  { // init inter-view regularization
     
    39654194  }
    39664195#endif
     4196#if VSP_MV_ZERO
     4197  else { // bIsVsp
     4198    m_pcRdCost->setMultiviewReg( 0 );
     4199  }
     4200#endif
    39674201
    39684202  setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList );
    39694203  //  Do integer search
     4204#if VSP_MV_ZERO
     4205  if ( !m_iFastSearch || bBi || bIsVsp )
     4206#else
    39704207  if ( !m_iFastSearch || bBi )
     4208#endif
    39714209  {
    39724210    xPatternSearch      ( pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost );
     
    39794217 
    39804218  m_pcRdCost->getMotionCost( 1, 0 );
     4219
    39814220#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    39824221  if( ! pcCU->getSlice()->getIsDepth() )
     
    39884227    xPatternSearchFracDIF( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost
    39894228                          ,bBi
     4229#if VSP_MV_ZERO
     4230                          ,bIsVsp
     4231#endif
    39904232                          );
    39914233  }
     
    40064248    ruiCost += m_pcRdCost->getCost( uiMvBits );
    40074249#endif
    4008  
     4250
     4251#if VSP_MV_ZERO
     4252  if( bIsVsp ) {
     4253    uiMvBits = 0; // vector zero & not output
     4254    assert( rcMv.getHor()==0 && rcMv.getVer()==0 );
     4255  }
     4256#endif
     4257
    40094258  ruiBits      += uiMvBits;
    40104259  ruiCost       = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) );
     
    43044553                                       UInt& ruiCost
    43054554                                       ,Bool biPred
     4555#if VSP_MV_ZERO
     4556                                       ,Bool bIsVsp
     4557#endif
    43064558                                       )
    43074559{
     
    43224574  rcMvHalf = *pcMvInt;   rcMvHalf <<= 1;    // for mv-cost
    43234575  TComMv baseRefMv(0, 0);
    4324   ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf   );
     4576  ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf
     4577#if VSP_MV_ZERO
     4578                                   ,bIsVsp
     4579#endif
     4580    );
    43254581 
    43264582  m_pcRdCost->setCostScale( 0 );
     
    43324588  rcMvQter = *pcMvInt;   rcMvQter <<= 1;    // for mv-cost
    43334589  rcMvQter += rcMvHalf;  rcMvQter <<= 1;
    4334   ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter );
     4590  ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter
     4591#if VSP_MV_ZERO
     4592                                   ,bIsVsp
     4593#endif
     4594    );
    43354595}
    43364596
     
    43674627#endif
    43684628  //  No residual coding : SKIP mode
    4369   if ( ePredMode == MODE_SKIP && bSkipRes )
     4629  if ( (ePredMode == MODE_SKIP && bSkipRes)
     4630#if FORCE_REF_VSP==1
     4631    || ePredMode == MODE_SYNTH
     4632#endif
     4633    )
    43704634  {
    43714635    rpcYuvResi->clear();
     
    57376001    m_pcEntropyCoder->resetBits();
    57386002    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     6003#if FORCE_REF_VSP==1
     6004    if( pcCU->getSlice()->getViewId() != 0 )
     6005#if VSP_TEXT_ONLY
     6006    if( !pcCU->getSlice()->getSPS()->isDepth() )
     6007#endif
     6008      m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     6009#endif
    57396010    m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true);
    57406011#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    57436014    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    57446015  }
     6016#if FORCE_REF_VSP==1
     6017  else if( pcCU->isVspMode( 0 ) )
     6018  {
     6019    m_pcEntropyCoder->resetBits();
     6020    m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     6021    m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     6022    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
     6023  }
     6024#endif
    57456025  else
    57466026  {
Note: See TracChangeset for help on using the changeset viewer.