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/TLibCommon/TComPrediction.cpp

    r156 r158  
    21172117{
    21182118  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
    2119   WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    21202119
    21212120  // get copy of co-located texture luma block
     
    21362135  UInt uiPredStride = cPredYuv.getStride();
    21372136
    2138   // regular wedge search
     2137  // wedge search
    21392138  TComWedgeDist cWedgeDist;
    21402139  UInt uiBestDist = MAX_UINT;
     
    21422141  Int  iDC1 = 0;
    21432142  Int  iDC2 = 0;
    2144 
     2143  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     2144
     2145#if HHIQC_DMMFASTSEARCH_B0039
     2146  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
     2147  TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
     2148  UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     2149  Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
     2150
     2151  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
     2152  if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
     2153  {
     2154    std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2];
     2155    for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
     2156    {
     2157      UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
     2158      calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2159      assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred,    uiPredStride, iDC1, iDC2 );
     2160
     2161      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2162
     2163      if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     2164      {
     2165        uiBestDist   = uiActDist;
     2166        uiBestTabIdx = uiIdx;
     2167      }
     2168    }
     2169  }
     2170  else
     2171  {
     2172    WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     2173    UInt uiBestNodeDist = MAX_UINT;
     2174    UInt uiBestNodeId   = 0;
     2175    for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
     2176    {
     2177      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2178      assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred,    uiPredStride, iDC1, iDC2 );
     2179
     2180      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2181
     2182      if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT )
     2183      {
     2184        uiBestNodeDist = uiActDist;
     2185        uiBestNodeId   = uiNodeId;
     2186      }
     2187    }
     2188
     2189    // refinement
     2190    uiBestDist   = uiBestNodeDist;
     2191    uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
     2192    for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ )
     2193    {
     2194      if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX )
     2195      {
     2196        calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2197        assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred,    uiPredStride, iDC1, iDC2 );
     2198
     2199        UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2200
     2201        if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     2202        {
     2203          uiBestDist   = uiActDist;
     2204          uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId );
     2205        }
     2206      }
     2207    }
     2208  }
     2209#else
    21452210  for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ )
    21462211  {
     
    21562221    }
    21572222  }
     2223#endif
    21582224
    21592225  cPredYuv.destroy();
Note: See TracChangeset for help on using the changeset viewer.