Ignore:
Timestamp:
3 May 2013, 17:16:12 (12 years ago)
Author:
tech
Message:

Fixed erroneously removed parts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r367 r368  
    4242#include "TLibCommon/ContextModel.h"
    4343#endif
     44#if H_MV
     45#include "../../App/TAppEncoder/TAppEncTop.h"
     46#endif
    4447
    4548//! \ingroup TLibEncoder
     
    7881  m_pcBitCounters          = NULL;
    7982  m_pcRdCosts              = NULL;
     83#if H_MV
     84  m_ivPicLists = NULL;
     85#endif
    8086}
    8187
     
    8995Void TEncTop::create ()
    9096{
     97#if !H_MV
    9198  // initialize global variables
    9299  initROM();
     100#endif
    93101 
    94102  // create processing unit classes
     
    268276  delete[] m_pcRdCosts;
    269277 
     278#if !H_MV
    270279    // destroy ROM
    271280  destroyROM();
     281#endif
    272282
    273283  return;
     
    319329// ====================================================================================================================
    320330
     331#if H_MV
     332Void TEncTop::initNewPic( TComPicYuv* pcPicYuvOrg )
     333{
     334  TComPic* pcPicCurr = NULL;
     335
     336  // get original YUV
     337  xGetNewPicBuffer( pcPicCurr );
     338  pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );
     339
     340  // compute image characteristics
     341  if ( getUseAdaptiveQP() )
     342  {
     343    m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) );
     344  }
     345}
     346#endif
    321347Void TEncTop::deletePicBuffer()
    322348{
     
    345371 \retval  iNumEncoded         number of encoded pictures
    346372 */
     373#if H_MV
     374Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId )
     375{
     376#else
    347377Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded )
    348378{
     379#endif
     380#if H_3D
     381  TComPic* picLastCoded = getPic( getGOPEncoder()->getPocLastCoded() );
     382  if( picLastCoded )
     383  {
     384    picLastCoded->compressMotion();
     385  }
     386#endif
     387#if H_MV
     388  if( gopId == 0)
     389  {
     390    m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 
     391#else
    349392  if (pcPicYuvOrg) {
    350393    // get original YUV
     
    365408    return;
    366409  }
     410#endif
    367411 
    368412#if RATE_CONTROL_LAMBDA_DOMAIN
     
    373417#endif
    374418
     419#if H_MV
     420  }
     421  m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId );
     422
     423  if( gopId + 1 == m_cGOPEncoder.getGOPSize() )
     424  {
     425#else
    375426  // compress GOP
    376427  m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut);
     428#endif
    377429
    378430#if RATE_CONTROL_LAMBDA_DOMAIN
     
    386438  m_iNumPicRcvd       = 0;
    387439  m_uiNumAllPicCoded += iNumEncoded;
     440#if H_MV
     441}
     442#endif
    388443}
    389444
     
    450505Void TEncTop::xInitSPS()
    451506{
     507#if H_MV
     508  m_cSPS.setSPSId( getLayerIdInVps() );
     509#endif
    452510  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    453511  profileTierLevel.setLevelIdc(m_level);
     
    594652Void TEncTop::xInitPPS()
    595653{
     654#if H_MV
     655  if( m_cVPS.getNumDirectRefLayers( getLayerIdInVps() ) > 0 )
     656  {
     657    m_cPPS.setListsModificationPresentFlag( true );
     658  }
     659  m_cPPS.setPPSId( getLayerIdInVps() );
     660  m_cPPS.setSPSId( getLayerIdInVps() );
     661#endif
    596662  m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
    597663  Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false;
     
    897963Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid )
    898964{
     965#if H_MV
     966  if( slice->getRapPicFlag() == true && getLayerId() > 0 && POCCurr == 0 )
     967  {
     968    TComReferencePictureSet* rps = slice->getLocalRPS();
     969    rps->setNumberOfNegativePictures(0);
     970    rps->setNumberOfPositivePictures(0);
     971    rps->setNumberOfLongtermPictures(0);
     972    rps->setNumberOfPictures(0);
     973    slice->setRPS(rps);
     974  }
     975  else
     976  {
     977#endif
    899978  slice->setRPSidx(GOPid);
    900979
     
    9241003  slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx()));
    9251004  slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures());
     1005#if H_MV
     1006  }
     1007#endif
    9261008
    9271009}
     
    10381120  }
    10391121}
     1122#if H_MV
     1123Void TEncTop::printSummary( Int numAllPicCoded )
     1124{
     1125  assert (numAllPicCoded == m_cAnalyzeAll.getNumPic());
     1126
     1127  //--CFG_KDY
     1128  m_cAnalyzeAll.setFrmRate( getFrameRate() );
     1129  m_cAnalyzeI.setFrmRate( getFrameRate() );
     1130  m_cAnalyzeP.setFrmRate( getFrameRate() );
     1131  m_cAnalyzeB.setFrmRate( getFrameRate() );
     1132
     1133  //-- all
     1134  printf( "\n\nSUMMARY ------------------------------------------- LayerId %2d\n", m_layerId );
     1135
     1136  m_cAnalyzeAll.printOut('a');
     1137
     1138  printf( "\n\nI Slices--------------------------------------------------------\n" );
     1139  m_cAnalyzeI.printOut('i');
     1140
     1141  printf( "\n\nP Slices--------------------------------------------------------\n" );
     1142  m_cAnalyzeP.printOut('p');
     1143
     1144  printf( "\n\nB Slices--------------------------------------------------------\n" );
     1145  m_cAnalyzeB.printOut('b');
     1146
     1147#if _SUMMARY_OUT_
     1148  m_cAnalyzeAll.printSummaryOut();
     1149#endif
     1150#if _SUMMARY_PIC_
     1151  m_cAnalyzeI.printSummary('I');
     1152  m_cAnalyzeP.printSummary('P');
     1153  m_cAnalyzeB.printSummary('B');
     1154#endif
     1155}
     1156
     1157Int TEncTop::getFrameId(Int iGOPid) 
     1158{
     1159  if(m_iPOCLast == 0)
     1160  {
     1161    return(0 );
     1162  }
     1163  else
     1164  {
     1165    return m_iPOCLast -m_iNumPicRcvd+ getGOPEntry(iGOPid).m_POC ;
     1166  }
     1167}
     1168
     1169TComPic* TEncTop::getPic( Int poc )
     1170{
     1171  TComList<TComPic*>* listPic = getListPic();
     1172  TComPic* pcPic = NULL;
     1173  for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++)
     1174  {
     1175    if( (*it)->getPOC() == poc )
     1176    {
     1177      pcPic = *it ;
     1178      break ;
     1179    }
     1180  }
     1181  return pcPic;
     1182}
     1183#endif
    10401184//! \}
Note: See TracChangeset for help on using the changeset viewer.