Ignore:
Timestamp:
30 Oct 2012, 12:09:04 (13 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/TComRom.cpp

    r77 r158  
    174174    g_aacWedgeRefLists.clear();
    175175  }
     176#if HHIQC_DMMFASTSEARCH_B0039
     177  if ( !g_aacWedgeNodeLists.empty() )
     178  {
     179    for ( UInt ui = 0; ui < g_aacWedgeNodeLists.size(); ui++ )
     180    {
     181      g_aacWedgeNodeLists[ui].clear();
     182    }
     183    g_aacWedgeNodeLists.clear();
     184  }
     185#endif
    176186#endif
    177187}
     
    11701180std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists;
    11711181
     1182#if HHIQC_DMMFASTSEARCH_B0039
     1183std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
     1184std::vector< std::vector< TComWedgeNode> >      g_aacWedgeNodeLists;
     1185#endif
     1186
    11721187Void initWedgeLists()
    11731188{
     
    11801195    g_aacWedgeLists.push_back( acWedgeList );
    11811196    g_aacWedgeRefLists.push_back( acWedgeRefList );
     1197
     1198#if HHIQC_DMMFASTSEARCH_B0039
     1199    // create WedgeNodeList
     1200    std::vector<TComWedgeNode> acWedgeNodeList;
     1201    for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ )
     1202    {
     1203      if( acWedgeList[uiPos].getIsCoarse() )
     1204      {
     1205        TComWedgeNode cWedgeNode;
     1206        cWedgeNode.setPatternIdx( uiPos );
     1207
     1208        // set refinement idxs
     1209        UInt uiRefPos = 0;
     1210        for( Int iOffS = -1; iOffS <= 1; iOffS++ )
     1211        {
     1212          for( Int iOffE = -1; iOffE <= 1; iOffE++ )
     1213          {
     1214            if( iOffS == 0 && iOffE == 0 ) { continue; }
     1215
     1216            Int iSx = (Int)acWedgeList[uiPos].getStartX();
     1217            Int iSy = (Int)acWedgeList[uiPos].getStartY();
     1218            Int iEx = (Int)acWedgeList[uiPos].getEndX();
     1219            Int iEy = (Int)acWedgeList[uiPos].getEndY();
     1220
     1221            switch( acWedgeList[uiPos].getOri() )
     1222            {
     1223            case( 0 ): { iSx += iOffS; iEy += iOffE; } break;
     1224            case( 1 ): { iSy += iOffS; iEx -= iOffE; } break;
     1225            case( 2 ): { iSx -= iOffS; iEy -= iOffE; } break;
     1226            case( 3 ): { iSy -= iOffS; iEx += iOffE; } break;
     1227            case( 4 ): { iSx += iOffS; iEx += iOffE; } break;
     1228            case( 5 ): { iSy += iOffS; iEy += iOffE; } break;
     1229            default: assert( 0 );
     1230            }
     1231
     1232            for( UInt k = 0; k < acWedgeRefList.size(); k++ )
     1233            {
     1234              if( iSx == (Int)acWedgeRefList[k].getStartX() &&
     1235                iSy == (Int)acWedgeRefList[k].getStartY() &&
     1236                iEx == (Int)acWedgeRefList[k].getEndX() &&
     1237                iEy == (Int)acWedgeRefList[k].getEndY()    )
     1238              {
     1239                if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() )
     1240                {
     1241                  Bool bNew = true;
     1242                  for( UInt m = 0; m < uiRefPos; m++ ) { if( acWedgeRefList[k].getRefIdx() == cWedgeNode.getRefineIdx( m ) ) { bNew = false; break; } }
     1243
     1244                  if( bNew )
     1245                  {
     1246                    cWedgeNode.setRefineIdx( acWedgeRefList[k].getRefIdx(), uiRefPos );
     1247                    uiRefPos++;
     1248                    break;
     1249                  }
     1250                }
     1251              }
     1252            }
     1253          }
     1254        }
     1255        acWedgeNodeList.push_back( cWedgeNode );
     1256      }
     1257    }
     1258    g_aacWedgeNodeLists.push_back( acWedgeNodeList );
     1259#endif
    11821260  }
    11831261  return;
     
    12171295      for( Int iL = 0; iL < uiBlockSize; iL++ )
    12181296      {
     1297#if HHIQC_DMMFASTSEARCH_B0039
     1298        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) );
     1299#else
    12191300        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes );
     1301#endif
    12201302        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
    12211303      }
    12221304    }
    12231305  }
     1306#if HHIQC_DMMFASTSEARCH_B0039
     1307  UInt uiThrSz = DMM3_SIMPLIFY_TR;
     1308
     1309  std::vector< std::vector<UInt> > auiWdgListSz;
     1310  for( Int idxM=2; idxM<=34 ; idxM++)
     1311  {
     1312    std::vector<UInt> auiWdgList;
     1313    for( Int idxW=0; idxW<racWedgeList.size(); idxW++)
     1314    {
     1315      UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng());
     1316      if( uiAbsDiff <= uiThrSz )
     1317      {
     1318        auiWdgList.push_back(idxW);
     1319      }
     1320    }
     1321    auiWdgListSz.push_back(auiWdgList);
     1322  }
     1323  g_aauiWdgLstM3.push_back(auiWdgListSz);
     1324#endif
    12241325}
    12251326
     
    12571358  if( bValid )
    12581359  {
     1360#if HHIQC_DMMFASTSEARCH_B0039
     1361  cWedgelet.findClosetAngle();
     1362#endif
    12591363    racWedgeList.push_back( cWedgelet );
    12601364    TComWedgeRef cWedgeRef;
Note: See TracChangeset for help on using the changeset viewer.