Ignore:
Timestamp:
26 Jan 2013, 19:36:53 (11 years ago)
Author:
mitsubishi-htm
Message:

-Integration of JCT3V-C0152 & JCT3V-C0131
-This check-in enable C0131 only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSearch.cpp

    r210 r231  
    696696UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey,
    697697                                    TComMv baseRefMv,
    698                                     Int iFrac, TComMv& rcMvFrac )
     698                                    Int iFrac, TComMv& rcMvFrac
     699                                   )
    699700{
    700701  UInt  uiDist;
     
    16881689  // reconstruct residual based on mask + DC residuals
    16891690  Pel apDCResiValues[2];
    1690   Pel apDCRecoValues[2];
     1691  //Pel apDCRecoValues[2];
    16911692  for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
    16921693  {
     
    16951696    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
    16961697   
    1697     apDCRecoValues[uiSegment]  = pRecoValue;
     1698    //apDCRecoValues[uiSegment]  = pRecoValue;
    16981699    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
    16991700  }
     
    28972898Void TEncSearch::xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiErr, Bool bHadamard )
    28982899{
     2900#if !MERL_VSP_C0152
    28992901  motionCompensation( pcCU, &m_tmpYuvPred, REF_PIC_LIST_X, iPartIdx );
    2900 
     2902#endif
    29012903  UInt uiAbsPartIdx = 0;
    29022904  Int iWidth = 0;
    29032905  Int iHeight = 0;
    29042906  pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight );
    2905 
     2907#if MERL_VSP_C0152
     2908  motionCompensationBWVSP( pcCU, &m_tmpYuvPred,  pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx );
     2909#endif
    29062910  DistParam cDistParam;
    29072911
     
    29432947#else
    29442948#if LG_RESTRICTEDRESPRED_M24766
     2949#if MERL_VSP_C0152
     2950Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue )
     2951#else
    29452952Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
     2953#endif
    29462954#else
    29472955Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
     
    29882996  }
    29892997#else
     2998#if MERL_VSP_C0152
     2999  pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue );
     3000#else
    29903001  pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    29913002#endif
     3003#endif
     3004
    29923005
    29933006#if HHI_INTER_VIEW_MOTION_PRED
     
    30093022      pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
    30103023      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
     3024#if MERL_VSP_C0152
     3025      {
     3026        Int iVSPIdx = 0;
     3027        Int numVSPIdx;
     3028        numVSPIdx = 3;
     3029        for (Int i = 0; i < numVSPIdx; i++)
     3030        {
     3031          if (iVSPIndexTrue[i] == uiMergeCand)
     3032            {
     3033              iVSPIdx = i+1;
     3034              break;
     3035            }
     3036        }
     3037        pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3038      }
     3039#endif
    30113040#if LG_RESTRICTEDRESPRED_M24766
    30123041      Int iAddResiShift;
     
    30813110Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    30823111#else
    3083 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
     3112Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG)
    30843113#endif
    30853114#else
     
    31853214    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    31863215    UInt          uiBitsTempL0[MAX_NUM_REF];
     3216
    31873217#if LG_RESTRICTEDRESPRED_M24766
    31883218    Int iPUResiPredShift[4] = {0, 0, 0, 0};
     
    31913221   
    31923222    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight );
    3193    
     3223#if MERL_VSP_C0152
     3224    //reset the VSP flag to be 0
     3225    pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
     3226#endif
    31943227#if AMP_MRG
    31953228    Bool bTestNormalMC = true;
     
    32063239      Bool bLastResiFlag = false;
    32073240#endif
     3241
    32083242    //  Uni-directional prediction
    32093243    for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ )
     
    35453579            xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    35463580          }
    3547          
     3581
    35483582          if ( uiCostTemp < uiCostBi )
    35493583          {
     
    37933827      TComMvField cMRGMvField[2];
    37943828      UInt uiMRGIndex = 0;
    3795 
     3829#if MERL_VSP_C0152
     3830      Int iVSPIndexTrue[3] = {-1, -1, -1};
     3831#endif
    37963832      UInt uiMEInterDir = 0;
    37973833      TComMvField cMEMvField[2];
     
    38443880#else
    38453881#if LG_RESTRICTEDRESPRED_M24766
     3882#if MERL_VSP_C0152
     3883      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
     3884#else
    38463885      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
     3886#endif
    38473887#else
    38483888      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
     
    38543894        pcCU->setMergeFlagSubParts ( true,          uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    38553895        pcCU->setMergeIndexSubParts( uiMRGIndex,    uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3896#if MERL_VSP_C0152
     3897        {
     3898          Int iVSPIdx = 0;
     3899          Int numVSPIdx;
     3900          numVSPIdx = 3;
     3901          for (Int i = 0; i < numVSPIdx; i++)
     3902          {
     3903            if (iVSPIndexTrue[i] == uiMRGIndex)
     3904              {
     3905                iVSPIdx = i+1;
     3906                break;
     3907              }
     3908          }
     3909          pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3910        }
     3911#endif
    38563912        pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    38573913        {
     
    38733929        pcCU->setMergeFlagSubParts( false,        uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    38743930        pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3931#if MERL_VSP_C0152
     3932        pcCU->setVSPIndexSubParts ( 0 ,           uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3933#endif
    38753934        {
    38763935          pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMEMvField[0], ePartSize, uiPartAddr, 0, iPartIdx );
     
    38813940
    38823941    //  MC
     3942#if MERL_VSP_C0152
     3943    motionCompensationBWVSP ( pcCU, rpcPredYuv, pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx);
     3944#else
    38833945    motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx );
    3884    
     3946#endif
    38853947  } //  end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ )
    38863948
     
    43384400  m_pcRdCost->setMultiviewReg( 0 );
    43394401#endif
     4402
    43404403  setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList );
    43414404  //  Do integer search
     
    43514414 
    43524415  m_pcRdCost->getMotionCost( 1, 0 );
     4416
    43534417#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    43544418  if( ! pcCU->getSlice()->getIsDepth() )
     
    43784442    ruiCost += m_pcRdCost->getCost( uiMvBits );
    43794443#endif
    4380  
     4444
    43814445  ruiBits      += uiMvBits;
    43824446  ruiCost       = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) );
     
    47234787  rcMvQter = *pcMvInt;   rcMvQter <<= 1;    // for mv-cost
    47244788  rcMvQter += rcMvHalf;  rcMvQter <<= 1;
    4725   ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter );
     4789  ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter);
    47264790}
    47274791
     
    47584822#endif
    47594823  //  No residual coding : SKIP mode
    4760   if ( ePredMode == MODE_SKIP && bSkipRes )
     4824  if ( (ePredMode == MODE_SKIP && bSkipRes) )
    47614825  {
    47624826    rpcYuvResi->clear();
Note: See TracChangeset for help on using the changeset viewer.