Ignore:
Timestamp:
30 Oct 2012, 12:09:04 (12 years ago)
Author:
hhi
Message:

Integration of B0039 (macro HHIQC_DMMFASTSEARCH_B0039).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev2-HHI/source/Lib/TLibEncoder/TEncSearch.cpp

    r156 r158  
    63366336  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    63376337  Dist iDist = RDO_DIST_MAX;
     6338#if HHIQC_DMMFASTSEARCH_B0039
     6339  WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     6340  xSearchWedgeFullMinDistFast( pcCU, uiAbsPtIdx, pacWedgeNodeList, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
     6341#else
    63386342  xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
     6343#endif
    63396344
    63406345  TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
     
    64466451  return;
    64476452}
     6453
     6454#if HHIQC_DMMFASTSEARCH_B0039
     6455Void TEncSearch::xSearchWedgeFullMinDistFast( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeNodeList* pacWedgeNodeList, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Dist& riDist )
     6456{
     6457  ruiTabIdx = 0;
     6458
     6459  // local pred buffer
     6460  TComYuv cPredYuv;
     6461  cPredYuv.create( uiWidth, uiHeight );
     6462  cPredYuv.clear();
     6463
     6464  UInt uiPredStride = cPredYuv.getStride();
     6465  Pel* piPred       = cPredYuv.getLumaAddr();
     6466
     6467  Int  iDC1 = 0;
     6468  Int  iDC2 = 0;
     6469
     6470  // coarse wedge search
     6471  Dist uiBestDist   = RDO_DIST_MAX;
     6472  UInt uiBestNodeId = 0;
     6473  for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
     6474  {
     6475    calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRef,  uiRefStride,  iDC1, iDC2 );
     6476    assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred, uiPredStride, iDC1, iDC2 );
     6477
     6478    Dist uiActDist = RDO_DIST_MAX;
     6479#if HHI_VSO
     6480    if( m_pcRdCost->getUseVSO() )
     6481    {
     6482#if SAIT_VSO_EST_A0033
     6483      if ( m_pcRdCost->getUseEstimatedVSD() )
     6484      {         
     6485        TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
     6486        TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
     6487        uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
     6488#if LGE_WVSO_A0119
     6489        if ( m_pcRdCost->getUseWVSO() )
     6490        {   
     6491          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6492          Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
     6493          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6494          uiActDist = (iDWeight * iD + iVSDWeight * (Int) uiActDist) / ( iDWeight + iVSDWeight);
     6495        }
     6496#endif
     6497      }
     6498      else
     6499#endif
     6500      {
     6501        uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     6502#if LGE_WVSO_A0119
     6503        if ( m_pcRdCost->getUseWVSO() )
     6504        {   
     6505          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6506          Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     6507          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6508          uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight);
     6509        }
     6510#endif
     6511      }
     6512    }
     6513    else
     6514    {
     6515      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6516    }
     6517#else
     6518    uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6519#endif
     6520    if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     6521    {
     6522      uiBestDist   = uiActDist;
     6523      uiBestNodeId = uiNodeId;
     6524    }
     6525  }
     6526
     6527  // refinement
     6528  Dist uiBestDistRef = uiBestDist;
     6529  UInt uiBestTabIdxRef  = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
     6530  for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ )
     6531  {
     6532    if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX )
     6533    {
     6534      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRef,  uiRefStride,  iDC1, iDC2 );
     6535      assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred, uiPredStride, iDC1, iDC2 );
     6536
     6537      Dist uiActDist = RDO_DIST_MAX;
     6538#if HHI_VSO
     6539      if( m_pcRdCost->getUseVSO() )
     6540      {
     6541        uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     6542#if LGE_WVSO_A0119
     6543        if ( m_pcRdCost->getUseWVSO() )
     6544        {   
     6545          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     6546          Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     6547          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6548          uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight);
     6549        }
     6550#endif
     6551      }
     6552      else
     6553      {
     6554        uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6555      }
     6556#else
     6557      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     6558#endif
     6559      if( uiActDist < uiBestDistRef || uiBestDistRef == RDO_DIST_MAX )
     6560      {
     6561        uiBestDistRef   = uiActDist;
     6562        uiBestTabIdxRef = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId );
     6563      }
     6564    }
     6565  }
     6566
     6567  riDist    = uiBestDistRef;
     6568  ruiTabIdx = uiBestTabIdxRef;
     6569
     6570  cPredYuv.destroy();
     6571  return;
     6572}
     6573#endif
    64486574
    64496575Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
Note: See TracChangeset for help on using the changeset viewer.