Ticket #1253: getIntraDirLumaPredictor.patch

File getIntraDirLumaPredictor.patch, 4.1 KB (added by kolya, 11 years ago)

patch for more clear code

  • source/Lib/TLibDecoder/TDecSbac.cpp

     
    602602
    603603Void TDecSbac::parseIntraDirLumaAng  ( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
    604604{
     605  const int iPredNum = 3;
    605606  PartSize mode = pcCU->getPartitionSize( absPartIdx );
    606607  UInt partNum = mode==SIZE_NxN?4:1;
    607608  UInt partOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(absPartIdx) << 1 ) ) >> 2;
     
    619620  for (j=0;j<partNum;j++)
    620621  {
    621622    Int preds[3] = {-1, -1, -1};
    622     Int predNum = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds); 
     623    pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds);
    623624    if (mpmPred[j])
    624625    {
    625626      m_pcTDecBinIf->decodeBinEP( symbol );
     
    648649      {
    649650        std::swap(preds[1], preds[2]);
    650651      }
    651       for ( Int i = 0; i < predNum; i++ )
     652      for ( Int i = 0; i < iPredNum; i++ )
    652653      {
    653654        intraPredMode += ( intraPredMode >= preds[i] );
    654655      }
  • source/Lib/TLibEncoder/TEncSearch.cpp

     
    24622462#if FAST_UDI_USE_MPM
    24632463      Int uiPreds[3] = {-1, -1, -1};
    24642464      Int iMode = -1;
    2465       Int numCand = pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode );
    2466       if( iMode >= 0 )
    2467       {
    2468         numCand = iMode;
    2469       }
     2465      pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode );
     2466      const Int iNumCand = iMode >= 0 ? iMode : 3;
    24702467     
    2471       for( Int j=0; j < numCand; j++)
     2468      for( Int j=0; j < iNumCand; j++)
    24722469      {
    24732470        Bool mostProbableModeIncluded = false;
    24742471        Int mostProbableMode = uiPreds[j];
  • source/Lib/TLibEncoder/TEncSbac.cpp

     
    619619  for (j=0;j<partNum;j++)
    620620  {
    621621    dir[j] = pcCU->getLumaIntraDir( absPartIdx+partOffset*j );
    622     predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 
     622    predNum[j] = 3;
     623    pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]);
    623624    for(UInt i = 0; i < predNum[j]; i++)
    624625    {
    625626      if(dir[j] == preds[j][i])
  • source/Lib/TLibCommon/TComDataCU.cpp

     
    16091609*\param   piMode          it is set with MPM mode in case both MPM are equal. It is used to restrict RD search at encode side.
    16101610*\returns Number of MPM
    16111611*/
    1612 Int TComDataCU::getIntraDirLumaPredictor( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode  )
     1612Void TComDataCU::getIntraDirLumaPredictor( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode  )
    16131613{
    16141614  TComDataCU* pcTempCU;
    16151615  UInt        uiTempPartIdx;
     
    16661666    }
    16671667  }
    16681668 
    1669   return uiPredNum;
     1669  return;
    16701670}
    16711671
    16721672UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth )
  • source/Lib/TLibCommon/TComDataCU.h

     
    435435  UInt          getIntraSizeIdx                 ( UInt uiAbsPartIdx                                       );
    436436 
    437437  Void          getAllowedChromaDir             ( UInt uiAbsPartIdx, UInt* uiModeList );
    438   Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
     438  Void          getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
    439439 
    440440  // -------------------------------------------------------------------------------------------------------------------
    441441  // member functions for SBAC context