Changeset 491 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0


Ignore:
Timestamp:
24 Jun 2013, 11:43:04 (11 years ago)
Author:
tech
Message:
  • Started integrating changes in decoding process
  • Fixed encoder help output
Location:
branches/HTM-DEV-0.3-dev0/source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r446 r491  
    732732        cOSS<<"Frame"<<i;
    733733        opts.addOptions()( cOSS.str(), m_GOPListMvc[k][i-1], GOPEntry() );
     734        if ( i != 1 )
     735        {
     736          opts.opt_list.back()->opt->opt_duplicate = true;
     737        }       
    734738      }
    735739    }
     
    738742      std::ostringstream cOSS1;
    739743      cOSS1<<"FrameI"<<"_l"<<k;
     744
    740745      opts.addOptions()(cOSS1.str(), m_GOPListMvc[k][MAX_GOP], GOPEntry());
     746      if ( k > 1 )
     747      {
     748        opts.opt_list.back()->opt->opt_duplicate = true;
     749      }       
     750
    741751
    742752      for( Int i = 1; i < MAX_GOP + 1; i++ )
     
    745755        cOSS2<<"Frame"<<i<<"_l"<<k;
    746756        opts.addOptions()(cOSS2.str(), m_GOPListMvc[k][i-1], GOPEntry());
     757        if ( i != 1 || k > 0 )
     758        {
     759          opts.opt_list.back()->opt->opt_duplicate = true;
     760        }       
    747761      }
    748762    }
  • branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.cpp

    r324 r491  
    3939#include <map>
    4040#include "program_options_lite.h"
    41 
     41#include  "../TLibCommon/TypeDef.h"
    4242using namespace std;
    4343
     
    146146      for(Options::NamesPtrList::iterator it = opts.opt_list.begin(); it != opts.opt_list.end(); it++)
    147147      {
     148#if H_MV
     149        if  ( (*it)->opt->opt_duplicate ) continue;
     150#endif
    148151        ostringstream line(ios_base::out);
    149152        doHelpOpt(line, **it, pad_short);
     
    161164      for(Options::NamesPtrList::iterator it = opts.opt_list.begin(); it != opts.opt_list.end(); it++)
    162165      {
     166#if H_MV
     167        if  ( (*it)->opt->opt_duplicate ) continue;
     168#endif
     169
    163170        ostringstream line(ios_base::out);
    164171        line << "  ";
  • branches/HTM-DEV-0.3-dev0/source/Lib/TAppCommon/program_options_lite.h

    r446 r491  
    3636#include <list>
    3737#include <map>
     38#include  "../TLibCommon/TypeDef.h"
    3839
    3940#if H_MV
     
    4142#include <errno.h>
    4243#include <cstring>
    43 
    4444#ifdef WIN32
    4545#define strdup _strdup
     
    8585    struct OptionBase
    8686    {
     87#if H_MV     
     88      OptionBase(const std::string& name, const std::string& desc, bool duplicate = false)
     89        : opt_string(name), opt_desc(desc), opt_duplicate(duplicate)
     90#else
    8791      OptionBase(const std::string& name, const std::string& desc)
    8892      : opt_string(name), opt_desc(desc)
     93#endif
    8994      {};
    9095     
     
    98103      std::string opt_string;
    99104      std::string opt_desc;
     105#if H_MV
     106      bool        opt_duplicate;
     107#endif
    100108    };
    101109   
     
    104112    struct Option : public OptionBase
    105113    {
     114#if H_MV
     115      Option(const std::string& name, T& storage, T default_val, const std::string& desc, bool duplicate = false)
     116        : OptionBase(name, desc, duplicate), opt_storage(storage), opt_default_val(default_val)
     117#else
    106118      Option(const std::string& name, T& storage, T default_val, const std::string& desc)
    107119      : OptionBase(name, desc), opt_storage(storage), opt_default_val(default_val)
     120#endif
    108121      {}
    109122     
     
    374387          sprintf((char*) cDescriptionBuffer.c_str(),desc.c_str(),uiK,uiK);
    375388
    376           parent.addOption(new Option<T>( cNameBuffer, (storage[uiK]), default_val, cDescriptionBuffer ));
     389          parent.addOption(new Option<T>( cNameBuffer, (storage[uiK]), default_val, cDescriptionBuffer, uiK != 0 ));
    377390        }
    378391
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r446 r491  
    32803280
    32813281  // use coldir.
     3282#if H_MV
     3283  TComPic *pColPic; 
     3284  if (getSlice()->getAltCollocatedIndicationFlag() )
     3285  {
     3286    pColPic = getSlice()->getPicFromRefPicSetInterLayer( getSlice()->getActiveMotionPredRefLayerId( getSlice()->getCollocatedRefLayerIdx() ));
     3287  }
     3288  else
     3289  {
     3290    pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 
     3291  } 
     3292#else
    32823293  TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
     3294#endif
    32833295  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    32843296  if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE)
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r490 r491  
    108108, m_enableTMVPFlag                ( true )
    109109#if H_MV
     110, m_refPicSetInterLayer           ( NULL )
    110111, m_layerId                       (0)
    111112, m_viewId                        (0)
     
    468469  UInt NumPocStCurr1 = 0;
    469470  UInt NumPocLtCurr = 0;
    470 #if H_MV
    471   Int numDirectRefLayers  = getVPS()->getNumDirectRefLayers( getLayerIdInVps() );
    472   assert( numDirectRefLayers == refPicSetInterLayer.size() );
    473 #endif
    474471  Int i;
    475472  for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
     
    519516  TComPic*  rpsCurrList0[MAX_NUM_REF+1];
    520517  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
     518
    521519#if H_MV
    522   Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + numDirectRefLayers;
     520 
     521  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + getNumActiveRefLayerPics( );
    523522  assert( numPocTotalCurr == getNumRpsCurrTempList() );
    524523#else
     
    558557
    559558  Int cIdx = 0;
     559#if H_MV
     560  if ( getInterRefEnabledInRPLFlag() )
     561  { 
     562#endif
    560563  for ( i=0; i<NumPocStCurr0; i++, cIdx++)
    561564  {
     
    571574  }
    572575#if H_MV
    573   for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
    574   {
    575     if( cIdx <= MAX_NUM_REF )
    576     {
    577       rpsCurrList0[cIdx] = refPicSetInterLayer[i];
    578     }
     576  }
     577  for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
     578  {
     579    assert( cIdx < MAX_NUM_REF );   
     580    rpsCurrList0[cIdx] = refPicSetInterLayer[i];   
    579581  }
    580582#endif
     
    583585  {
    584586    cIdx = 0;
     587#if H_MV
     588    if ( getInterRefEnabledInRPLFlag() )
     589    { 
     590#endif
    585591    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    586592    {
     
    596602    }
    597603#if H_MV
    598     for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
    599     {
    600       if( cIdx <= MAX_NUM_REF )
    601       {
    602         rpsCurrList1[cIdx] = refPicSetInterLayer[i];
    603       }
     604    }
     605    for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
     606    {
     607      assert( cIdx < MAX_NUM_REF );   
     608      rpsCurrList1[cIdx] = refPicSetInterLayer[i];   
    604609    }
    605610#endif
     
    664669  }
    665670#if H_MV
    666   numRpsCurrTempList = numRpsCurrTempList + getVPS()->getNumDirectRefLayers( getLayerIdInVps() );
     671  numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
    667672#endif
    668673  return numRpsCurrTempList;
     
    22732278  refPicSetInterLayer.clear();
    22742279
    2275   for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerIdInVps() ); i++ )
    2276   {
    2277     Int layerIdRef = getVPS()->getRefLayerId( getLayerIdInVps(), i );
     2280  for( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
     2281  {
     2282    Int layerIdRef = getRefPicLayerId( i );
    22782283    TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ;
    22792284    assert ( picRef != 0 );
     
    22832288    picRef->getSlice(0)->setReferenced( true );       
    22842289
     2290    // Consider to check here:
     2291    // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. "
    22852292    refPicSetInterLayer.push_back( picRef );
    22862293  }
     
    23612368  while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
    23622369  return ceilLog2;
     2370}
     2371
     2372Void TComSlice::markCurrPic( TComPic* currPic )
     2373{
     2374  if ( currPic->getSlice(0)->getDiscardableFlag() )
     2375  {
     2376    currPic->getSlice(0)->setReferenced( true ) ;
     2377    currPic->setIsLongTerm( false );
     2378  }
     2379  else
     2380  {
     2381    currPic->getSlice(0)->setReferenced( false ) ;
     2382  }
     2383}
     2384
     2385Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )
     2386{
     2387  m_refPicSetInterLayer = refPicSetInterLayer;
     2388}
     2389
     2390TComPic* TComSlice::getPicFromRefPicSetInterLayer( Int layerId )
     2391{
     2392  assert( m_refPicSetInterLayer != 0 );
     2393  assert( (*m_refPicSetInterLayer).size() == getNumActiveRefLayerPics() );
     2394  TComPic* pcPic = NULL;
     2395  for ( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
     2396  {
     2397    if ((*m_refPicSetInterLayer)[ i ]->getLayerId() == layerId)
     2398    {
     2399      pcPic = (*m_refPicSetInterLayer)[ i ];
     2400    }
     2401  }
     2402  assert(pcPic != NULL);
     2403  return pcPic;
    23632404}
    23642405
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h

    r490 r491  
    15861586  Bool       m_enableTMVPFlag;
    15871587#if H_MV
     1588  std::vector<TComPic*>* m_refPicSetInterLayer;
    15881589  Int        m_layerId;
    15891590  Int        m_viewId;
     
    17811782  Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );
    17821783  static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer );
    1783   static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
    1784 
    1785 
    1786   Void xPrintRefPicList();
     1784  static Void markCurrPic                 ( TComPic* currPic );;
     1785  static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc );
     1786   Void xPrintRefPicList();
    17871787#endif
    17881788  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
     
    19621962  return interRefEnabledInRPLFlag;
    19631963}
    1964 #endif
     1964
     1965Void setRefPicSetInterLayer( std::vector<TComPic*>* m_refPicSetInterLayer );
     1966
     1967TComPic* getPicFromRefPicSetInterLayer( Int layerId );
     1968
     1969#endif
     1970
     1971
    19651972protected:
    19661973  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
     
    19681975TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
    19691976#if H_MV
    1970   TComPic*  xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );
    19711977  Int       xCeilLog2( Int val );
    19721978#endif
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r490 r491  
    518518#if H_MV
    519519  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
     520  TComSlice::markCurrPic( pcPic );
    520521  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
    521522#endif
     
    673674
    674675#if H_MV
     676  m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer );
    675677  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    676678#endif
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r446 r491  
    498498    pcSlice->setSliceIdx(0);
    499499#if H_MV
     500    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer );
    500501    pcPic  ->setLayerId     ( getLayerId()   );
    501502    pcPic  ->setViewId      ( getViewId()    );   
     
    20612062
    20622063      pcPic->setReconMark   ( true );
    2063 #if H_MV
     2064#if H_MV     
    20642065      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
    20652066      std::vector<Int> temp;
     2067      TComSlice::markCurrPic( pcPic );
    20662068      TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() );
    20672069#endif
Note: See TracChangeset for help on using the changeset viewer.