Ignore:
Timestamp:
4 Feb 2013, 01:35:46 (12 years ago)
Author:
lg
Message:

Integration of JCT3V-C0044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComPrediction.cpp

    r242 r251  
    21362136}
    21372137
     2138#if LGE_DMM3_SIMP_C0044
     2139/**
     2140 - fetch best Wedgelet pattern at decoder
     2141 */
     2142UInt TComPrediction::getBestWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt IntraTabIdx)
     2143{
     2144  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
     2145
     2146  UInt          uiBestTabIdx = 0;
     2147  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
     2148  TComDataCU*   pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
     2149  UInt          uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     2150  Int           uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
     2151
     2152  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
     2153
     2154  if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
     2155  {
     2156    std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2];
     2157    uiBestTabIdx    =   pauiWdgLst->at(IntraTabIdx);
     2158  }
     2159  else
     2160  {
     2161    WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     2162    uiBestTabIdx = pacWedgeNodeList->at(IntraTabIdx).getPatternIdx();
     2163  }
     2164
     2165  return uiBestTabIdx;
     2166}
     2167#endif
     2168
     2169#if LGE_DMM3_SIMP_C0044
     2170/**
     2171 - calculate best Wedgelet pattern at encoder
     2172 */
     2173UInt TComPrediction::getBestWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Pel* piOrigi, UInt uiStride, UInt & ruiIntraTabIdx)
     2174#else
    21382175UInt TComPrediction::getBestWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight )
     2176#endif
    21392177{
    21402178  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
     
    21642202  Int  iDC2 = 0;
    21652203  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    2166 
     2204#if LGE_DMM3_SIMP_C0044
     2205  ruiIntraTabIdx  = 0;
     2206#endif
    21672207#if HHIQC_DMMFASTSEARCH_B0039
    21682208  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
     
    21782218    {
    21792219      UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
     2220#if LGE_DMM3_SIMP_C0044
     2221      calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piOrigi,   uiWidth,      iDC1, iDC2 );
     2222#else
    21802223      calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2224#endif
    21812225      assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred,    uiPredStride, iDC1, iDC2 );
    21822226
     2227#if LGE_DMM3_SIMP_C0044
     2228      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piOrigi, uiStride, uiWidth, uiHeight, WedgeDist_SAD );
     2229#else
    21832230      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2231#endif
    21842232
    21852233      if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     
    21872235        uiBestDist   = uiActDist;
    21882236        uiBestTabIdx = uiIdx;
     2237#if LGE_DMM3_SIMP_C0044
     2238        ruiIntraTabIdx = uiIdxW;
     2239#endif
    21892240      }
    21902241    }
     
    21972248    for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
    21982249    {
     2250#if LGE_DMM3_SIMP_C0044
     2251      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piOrigi, uiWidth,      iDC1, iDC2 );
     2252#else
    21992253      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2254#endif
    22002255      assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred,    uiPredStride, iDC1, iDC2 );
    22012256
     2257#if LGE_DMM3_SIMP_C0044
     2258      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piOrigi, uiStride, uiWidth, uiHeight, WedgeDist_SAD );
     2259#else
    22022260      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2261#endif
    22032262
    22042263      if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT )
     
    22062265        uiBestNodeDist = uiActDist;
    22072266        uiBestNodeId   = uiNodeId;
    2208       }
    2209     }
    2210 
     2267#if LGE_DMM3_SIMP_C0044
     2268        ruiIntraTabIdx = uiNodeId;
     2269#endif
     2270      }
     2271    }
     2272#if LGE_DMM3_SIMP_C0044
     2273    uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
     2274#else
    22112275    // refinement
    22122276    uiBestDist   = uiBestNodeDist;
     
    22282292      }
    22292293    }
     2294#endif
    22302295  }
    22312296#else
     
    22822347  {
    22832348    // decoder: get and store wedge pattern in CU
     2349      // decoder: get and store wedge pattern in CU
     2350#if LGE_DMM3_SIMP_C0044
     2351    UInt uiIntraTabIdx   = pcCU->getWedgePredTexIntraTabIdx ( uiAbsPartIdx );
     2352    uiTextureWedgeTabIdx = getBestWedgeFromTex( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight, uiIntraTabIdx );
     2353#else
    22842354    uiTextureWedgeTabIdx = getBestWedgeFromTex( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight );
     2355#endif
    22852356
    22862357    UInt uiDepth = (pcCU->getDepth(0)) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1);
Note: See TracChangeset for help on using the changeset viewer.