Changeset 332 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp


Ignore:
Timestamp:
21 Apr 2013, 19:13:11 (13 years ago)
Author:
tech
Message:

Merged branch 6.1-Cleanup@329.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r296 r332  
    23112311      for( UInt uiSDC=0; uiSDC<=uiUseSDC; uiSDC++ )
    23122312      {
    2313 #if FIX_SDC_ENC_C0143
    23142313        for( UInt uiRes = 0; uiRes<=uiSDC; uiRes++ )
    2315 #else
    2316         for( UInt uiRes = 0; uiRes<=uiUseSDC; uiRes++ )
    2317 #endif
    23182314        {
    23192315#endif
     
    29092905 * \returns Void
    29102906 */
     2907
     2908Void TEncSearch::xMergeEstimation( TComDataCU*     pcCU,
     2909                                 TComYuv*        pcYuvOrg,
     2910                                 Int             iPUIdx,
     2911                                 UInt&           uiInterDir,
     2912                                 TComMvField*    pacMvField,
     2913                                 UInt&           uiMergeIndex,
     2914                                 UInt&           ruiCost
    29112915#if CU_BASED_MRG_CAND_LIST
    2912 #if LG_RESTRICTEDRESPRED_M24766
    2913 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
    2914 #else
    2915 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
    2916 #endif
    2917 #else
    2918 #if LG_RESTRICTEDRESPRED_M24766
    2919 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138
    2920 #if !MTK_MDIVRP_C0138
    2921 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue )
    2922 #endif
    2923 #if !MERL_VSP_C0152
    2924 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2925 #endif
    2926 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138
    2927 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue  )
    2928 #endif
    2929 #else
    2930 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2931 #endif
    2932 #else
    2933 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2934 #endif
    2935 #endif
     2916                                 , TComMvField* cMvFieldNeighbours, 
     2917                                 UChar* uhInterDirNeighbours,
     2918                                 Int& numValidMergeCand
     2919#endif
     2920#if MERL_VSP_C0152
     2921                                 , Int* iVSPIndexTrue
     2922#endif
     2923                                 )
    29362924{
    29372925#if !CU_BASED_MRG_CAND_LIST
     
    29852973  const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    29862974#endif
    2987 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    2988   Int iPUResiPredShift[4];
    2989   Int iLastAddResiShift = -1000;
    2990 #endif
    29912975  ruiCost = MAX_UINT;
    29922976  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
     
    30142998        }
    30152999        pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3016       }
    3017 #endif
    3018 #if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    3019       Int iAddResiShift;
    3020       UInt uiPartAddr;
    3021       Int iRoiWidth, iRoiHeight;
    3022 
    3023       pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight );
    3024       iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    3025       iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1);
    3026 
    3027       if( pcCU->getResPredFlag( 0 ))
    3028       { // subtract residual prediction from original in motion search
    3029         if(iLastAddResiShift != iAddResiShift)
    3030         {
    3031           //add subtracted residual last time
    3032           if(iLastAddResiShift >= 0)
    3033           {
    3034             iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3035             pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3036           }
    3037           //subtract residual
    3038           if(iAddResiShift >= 0)
    3039           {
    3040             iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;
    3041             pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3042           }
    3043           iLastAddResiShift = iAddResiShift;
    3044         }
    30453000      }
    30463001#endif
     
    30663021    }
    30673022  }
    3068 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3069   if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    3070   {
    3071     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3072     pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3073   }
    3074 #endif
    30753023}
    30763024
     
    30853033 */
    30863034#if AMP_MRG
    3087 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3088 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    3089 #else
    30903035Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG)
    3091 #endif
    30923036#else
    30933037Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes )
     
    31883132    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    31893133    UInt          uiBitsTempL0[MAX_NUM_REF];
    3190 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3191     Int iPUResiPredShift[4] = {0, 0, 0, 0};
    3192 #endif
    31933134    xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits);
    31943135   
     
    32093150    {
    32103151#endif
    3211 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3212       Bool bLastResiFlag = false;
    3213 #endif
    32143152
    32153153    //  Uni-directional prediction
     
    32203158      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    32213159      {
    3222 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3223         if( pcCU->getResPredFlag( 0 ))
    3224         {
    3225           if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))
    3226           { // subtract residual prediction from original in motion search
    3227             if(!bLastResiFlag)
    3228               pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3229             bLastResiFlag = true;
    3230           }
    3231           else
    3232           {
    3233             if(bLastResiFlag)
    3234               pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3235             bLastResiFlag = false;
    3236           }
    3237         }
    3238 #endif
    32393160        uiBitsTemp = uiMbBits[iRefList];
    32403161        if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 )
     
    33943315      }
    33953316    }
    3396 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3397     if( pcCU->getResPredFlag( 0 ) && bLastResiFlag)
    3398     { // subtract residual prediction from original in motion search
    3399       pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3400     }
    3401 #endif
    34023317    //  Bi-directional prediction
    34033318    if ( pcCU->getSlice()->isInterB() )
    34043319    {
    3405 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3406       Int iLastAddResiShift = -1000;
    3407 #endif
    34083320      cMvBi[0] = cMv[0];            cMvBi[1] = cMv[1];
    34093321      iRefIdxBi[0] = iRefIdx[0];    iRefIdxBi[1] = iRefIdx[1];
     
    34993411#else
    35003412          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    3501 #endif
    3502 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3503           Int iAddResiShift = -1, iPredFrom = 0;
    3504           Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
    3505 
    3506           iPredFrom = iBestRefIdx >= 0 ? 3 : 1;
    3507           if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx))
    3508             iAddResiShift++;
    3509           if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))
    3510             iAddResiShift++;
    3511           iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3512 
    3513           if( pcCU->getResPredFlag( 0 ) )
    3514           {
    3515             if(iLastAddResiShift != iAddResiShift)
    3516             {
    3517               //add substracted residual last time
    3518               if(iLastAddResiShift >= 0 )
    3519               {
    3520                 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3521                 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3522               }
    3523               //substract residual
    3524               if(iAddResiShift >= 0)
    3525               {
    3526                 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;
    3527                 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3528               }
    3529               iLastAddResiShift = iAddResiShift;
    3530             }
    3531           }
    35323413#endif
    35333414          // call ME
     
    35813462        }
    35823463      } // for loop-iter
    3583 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3584       if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    3585       {
    3586         iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3587         pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3588       }
    3589 #endif
    35903464    } // if (B_SLICE)
    35913465#if ZERO_MVD_EST
     
    37963670      if (bTestNormalMC)
    37973671      {
    3798 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3799         Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    3800         iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \
    3801           (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3802         if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    3803         {
    3804           pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true);
    3805         }
    3806 #endif
    38073672        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    38083673        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
    3809 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3810         if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    3811         {
    3812           pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3813         }
    3814 #endif
    38153674      }
    38163675#else
     
    38273686      // find Merge result
    38283687      UInt uiMRGCost = MAX_UINT;
     3688
     3689
     3690xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost
    38293691#if CU_BASED_MRG_CAND_LIST
    3830 #if LG_RESTRICTEDRESPRED_M24766
    3831       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    3832 #else
    3833       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    3834 #endif
    3835 #else
    3836 #if LG_RESTRICTEDRESPRED_M24766
    3837 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138
    3838 
    3839 #if !MTK_MDIVRP_C0138
    3840       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
    3841 #endif
    3842 
    3843 #if !MERL_VSP_C0152
    3844       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3845 #endif
    3846 
    3847 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138
    3848       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
    3849 #endif
    3850 
    3851 #else
    3852       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3853 #endif
    3854 
    3855 
    3856 #else
    3857       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3858 #endif
    3859 #endif
     3692                 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand,
     3693#endif
     3694#if MERL_VSP_C0152
     3695                 , iVSPIndexTrue
     3696#endif
     3697        );
     3698
    38603699      if ( uiMRGCost < uiMECost )
    38613700      {
     
    47754614  UInt      uiWidth      = pcCU->getWidth ( 0 );
    47764615  UInt      uiHeight     = pcCU->getHeight( 0 );
    4777 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    4778   Int       iPUResiPredShift[4];
    4779 #endif
    47804616  //  No residual coding : SKIP mode
    47814617  if ( ePredMode == MODE_SKIP && bSkipRes )
     
    47854621    pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    47864622   
    4787 #if MTK_MDIVRP_C0138
     4623#if H3D_IVRP
    47884624    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    47894625    {
    47904626      rpcYuvRec->clip( uiWidth, uiHeight );
    47914627    }
    4792 #else
    4793 #if H3D_IVRP
    4794     // add residual prediction
    4795     if( pcCU->getResPredFlag( 0 ) )
    4796     {
    4797 #if LG_RESTRICTEDRESPRED_M24766
    4798       pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    4799       rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight );
    4800 #else
    4801       rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight );
    4802 #endif
    4803       rpcYuvRec->clip( uiWidth, uiHeight );
    4804     }
    4805 #endif
    48064628#endif
    48074629
     
    48534675      );
    48544676#endif
    4855 #if H3D_IVRP && !MTK_MDIVRP_C0138
    4856     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    4857 #endif
    48584677#if HHI_MPI
    48594678    }
     
    49224741  else
    49234742  {
    4924 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    4925     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    4926     rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth );
    4927 #else
    49284743  rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
    4929 #endif
    4930 #if H3D_IVRP && !MTK_MDIVRP_C0138
    4931     // subtract residual prediction
    4932     if( pcCU->getResPredFlag( 0 ) )
    4933     {
    4934 #if LG_RESTRICTEDRESPRED_M24766
    4935       pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    4936       rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth );
    4937 #else
    4938       rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth );
    4939 #endif
    4940     }
    4941 #endif
    49424744  }
    49434745#else
     
    51344936#endif
    51354937  }
    5136 #if H3D_IVRP && !MTK_MDIVRP_C0138
    5137   // add residual prediction
    5138   if( pcCU->getResPredFlag( 0 ) )
    5139   {
    5140     pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    5141 #if LG_RESTRICTEDRESPRED_M24766
    5142     pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    5143     rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd,   uiWidth, uiHeight );
    5144     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    5145     rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight );
    5146 #else
    5147     rpcYuvRec->add( rpcYuvResPrd,   uiWidth, uiHeight );
    5148     rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight );
    5149 #endif
    5150     rpcYuvRec->clip( uiWidth, uiHeight );
    5151   }
    5152   else
    5153 #endif
    51544938  rpcYuvRec->addClip ( pcYuvPred, rpcYuvResiBest, 0, uiWidth );
    51554939 
     
    61705954      );
    61715955#endif
    6172 #if H3D_IVRP && !MTK_MDIVRP_C0138
    6173     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    6174 #endif
    61755956    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    61765957  }
     
    61965977#endif
    61975978      );
    6198 #endif
    6199 #if H3D_IVRP && !MTK_MDIVRP_C0138
    6200     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    62015979#endif
    62025980#if HHI_MPI
     
    65346312    Int iFullDeltaDC2 = riDeltaDC2;
    65356313
    6536 #if HHI_DMM_DELTADC_Q1_C0034
    6537 #else
    6538     xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC1 );
    6539     xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC2 );
    6540 #endif
    6541 
    65426314    Dist uiBestDist     = RDO_DIST_MAX;
    65436315    UInt  uiBestQStepDC1 = 0;
     
    65516323    uiDeltaDC2Max += (uiDeltaDC2Max>>1);
    65526324
    6553 #if HHI_DMM_DELTADC_Q1_C0034
    65546325    // limit search range to [0, IBDI_MAX]
    65556326    if( iFullDeltaDC1 <  0 && uiDeltaDC1Max >                abs(iPredDC1) ) { uiDeltaDC1Max =                abs(iPredDC1); }
     
    66986469      }
    66996470    }
    6700 #else
    6701     for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
    6702     {
    6703       Int iLevelDeltaDC1 = (Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1);
    6704       xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 );
    6705 
    6706       Int iTestDC1 = Clip( iPredDC1 + iLevelDeltaDC1 );
    6707       for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++  )
    6708       {
    6709         Int iLevelDeltaDC2 = (Int)(uiQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1);
    6710         xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 );
    6711 
    6712         Int iTestDC2 = Clip( iPredDC2 + iLevelDeltaDC2 );
    6713 
    6714         assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 );
    6715        
    6716         Dist uiActDist = RDO_DIST_MAX;
    6717 #if SAIT_VSO_EST_A0033
    6718         if ( m_pcRdCost->getUseEstimatedVSD() )
    6719         {         
    6720           TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
    6721           TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
    6722           uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
    6723 #if LGE_WVSO_A0119
    6724           if ( m_pcRdCost->getUseWVSO() )
    6725           {   
    6726             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6727             Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
    6728             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6729             uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight);
    6730           }
    6731 #endif // LGE_WVSO_A0119
    6732         }
    6733         else       
    6734 #endif // SAIT_VSO_EST_A0033
    6735         {       
    6736           uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
    6737 #if LGE_WVSO_A0119
    6738           if ( m_pcRdCost->getUseWVSO() )
    6739           {   
    6740             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6741             Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
    6742             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6743             uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight);
    6744           }
    6745 #endif // LGE_WVSO_A0119
    6746         }
    6747 
    6748         if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    6749         {
    6750           uiBestDist     = uiActDist;
    6751           uiBestQStepDC1 = uiQStepDC1;
    6752           uiBestQStepDC2 = uiQStepDC2;
    6753         }
    6754       }
    6755     }
    6756 #endif
     6471
    67576472    iFullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1);
    67586473    iFullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1);
    6759 #if HHI_DMM_DELTADC_Q1_C0034
    6760 #else
    6761     xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC1 );
    6762     xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC2 );
    6763 #endif
     6474
    67646475    riDeltaDC1 = iFullDeltaDC1;
    67656476    riDeltaDC2 = iFullDeltaDC2;
     
    67676478#endif
    67686479
    6769 #if HHI_DMM_DELTADC_Q1_C0034
    6770 #else
    6771   xDeltaDCQuantScaleDown( pcCU, riDeltaDC1 );
    6772   xDeltaDCQuantScaleDown( pcCU, riDeltaDC2 );
    6773 #endif
    67746480}
    67756481#endif
Note: See TracChangeset for help on using the changeset viewer.