Changeset 71 in 3DVCSoftware for branches/HTM-3.0-Vidyo/source


Ignore:
Timestamp:
5 Jun 2012, 04:47:14 (13 years ago)
Author:
vidyo
Message:

additional changes to make decoder use VPS parameters

Location:
branches/HTM-3.0-Vidyo/source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-3.0-Vidyo/source/App/TAppDecoder/TAppDecTop.cpp

    r70 r71  
    8282Void TAppDecTop::decode()
    8383{
     84#if VIDYO_VPS_INTEGRATION
     85  increaseNumberOfViews( 0, 0, 0 );
     86#else
    8487  increaseNumberOfViews( 1 );
     88#endif
     89 
    8590#if SONY_COLPIC_AVAILABILITY
    8691  m_tDecTop[0]->setViewOrderIdx(0);
     
    141146      read(nalu, nalUnit);
    142147#if VIDYO_VPS_INTEGRATION
     148      Int viewId = 0;
     149      Int depth = 0;
     150     
     151      if(nalu.m_nalUnitType != NAL_UNIT_VPS || nalu.m_layerId)
     152      {
     153        // code assumes that the first nal unit is VPS
     154        // currently, this is a hack that requires non-first VPSs have non-zero layer_id
     155        viewId = getVPSAccess()->getActiveVPS()->getViewId(nalu.m_layerId);
     156        depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId);
     157      }
    143158      viewDepthId = nalu.m_layerId;   // coding order T0D0T1D1T2D2
    144159#else
     
    151166      if( viewDepthId >= m_tDecTop.size() )     
    152167      {
     168#if VIDYO_VPS_INTEGRATION
     169        increaseNumberOfViews( viewDepthId, viewId, depth );
     170#else
    153171        increaseNumberOfViews( viewDepthId +1 );
     172#endif   
    154173      }
    155174      if(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer)
     
    397416  m_pocLastDisplay[viewDepthId] = -MAX_INT;
    398417}
    399 
     418#if VIDYO_VPS_INTEGRATION
     419Void  TAppDecTop::increaseNumberOfViews  ( UInt layerId, UInt viewId, UInt isDepth )
     420#else
    400421Void  TAppDecTop::increaseNumberOfViews  ( Int newNumberOfViewDepth )
    401 {
     422#endif
     423{
     424#if VIDYO_VPS_INTEGRATION
     425  Int newNumberOfViewDepth = layerId + 1;
     426#endif
    402427  if ( m_outputBitDepth == 0 )
    403428  {
    404429    m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement;
    405430  }
     431#if !VIDYO_VPS_INTEGRATION
    406432  Int viewId = (newNumberOfViewDepth-1)>>1;   // coding order T0D0T1D1T2D2
    407433  Bool isDepth = ((newNumberOfViewDepth % 2) == 0);  // coding order T0D0T1D1T2D2
     434#endif
    408435  if( isDepth )
    409436    m_useDepth = true;
  • branches/HTM-3.0-Vidyo/source/App/TAppDecoder/TAppDecTop.h

    r56 r71  
    7474  CamParsCollector                m_cCamParsCollector;
    7575#if DEPTH_MAP_GENERATION
     76#if VIDYO_VPS_INTEGRATION
     77  TComVPSAccess                   m_cVPSAccess;
     78#endif
    7679  TComSPSAccess                   m_cSPSAccess;
    7780  TComAUPicAccess                 m_cAUPicAccess;
     
    8588  Void  destroy           (); ///< destroy internal members
    8689  Void  decode            (); ///< main decoding function
     90#if VIDYO_VPS_INTEGRATION
     91  Void  increaseNumberOfViews   (UInt layerId, UInt viewId, UInt isDepth);
     92#else
    8793  Void  increaseNumberOfViews   (Int newNumberOfViewDepth);
     94#endif
    8895  TDecTop* getTDecTop     ( Int viewId, Bool isDepth );
    8996
     
    9299
    93100#if DEPTH_MAP_GENERATION
     101#if VIDYO_VPS_INTEGRATION
     102  TComVPSAccess*    getVPSAccess  () { return &m_cVPSAccess;   }
     103#endif
    94104  TComSPSAccess*    getSPSAccess  () { return &m_cSPSAccess;   }
    95105  TComAUPicAccess*  getAUPicAccess() { return &m_cAUPicAccess; }
  • branches/HTM-3.0-Vidyo/source/App/TAppEncoder/TAppEncTop.h

    r70 r71  
    8080
    8181#if DEPTH_MAP_GENERATION
     82#if VIDYO_VPS_INTEGRATION
     83  TComVPSAccess               m_cVPSAccess;
     84#endif
    8285  TComSPSAccess               m_cSPSAccess;
    8386  TComAUPicAccess             m_cAUPicAccess;
     
    137140#if VIDYO_VPS_INTEGRATION
    138141  TComVPS*          getVPS()  { return &m_cVPS; }
     142  TComVPSAccess*    getVPSAccess  () { return &m_cVPSAccess;   }
    139143#endif
    140144 
  • branches/HTM-3.0-Vidyo/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r56 r71  
    122122}
    123123
     124#if VIDYO_VPS_INTEGRATION
     125Void
     126TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess )
     127#else
    124128Void
    125129TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess )
     130#endif
    126131{
    127132  AOF( pcPrediction  );
     
    130135  uninit();
    131136  m_pcPrediction  = pcPrediction;
     137#if VIDYO_VPS_INTEGRATION
     138  m_pcVPSAccess   = pcVPSAccess;
     139#endif
    132140  m_pcSPSAccess   = pcSPSAccess;
    133141  m_pcAUPicAccess = pcAUPicAccess;
     
    157165
    158166  // update SPS list and AU pic list and set depth map generator in SPS
     167#if VIDYO_VPS_INTEGRATION
     168  m_pcVPSAccess  ->addVPS( pcPic->getVPS() );
     169#endif
    159170  m_pcSPSAccess  ->addSPS( pcPic->getSPS() );
    160171  m_pcAUPicAccess->addPic( pcPic );
  • branches/HTM-3.0-Vidyo/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r56 r71  
    5050
    5151#if DEPTH_MAP_GENERATION
    52 
     52#if VIDYO_VPS_INTEGRATION
     53class TComVPSAccess // would be better to have a real VPS buffer
     54{
     55public:
     56  TComVPSAccess ()  { clear(); }
     57  ~TComVPSAccess()  {}
     58 
     59  Void      clear   ()                                { ::memset( m_aacVPS, 0x00, sizeof( m_aacVPS ) ); m_uiActiceVPSId = 0;}
     60  Void      addVPS  ( TComVPS* pcVPS )                { m_aacVPS[ pcVPS->getVPSId() ] = pcVPS; }
     61  TComVPS*  getVPS  ( UInt uiVPSId )                  { return m_aacVPS[ uiVPSId ]; }
     62  TComVPS*  getActiveVPS  ( )                         { return m_aacVPS[ m_uiActiceVPSId ]; }
     63  Void      setActiveVPSId  ( UInt activeVPSId )      { m_uiActiceVPSId = activeVPSId; }
     64private:
     65  TComVPS*  m_aacVPS[ MAX_NUM_VPS ];
     66  UInt      m_uiActiceVPSId;
     67};
     68#endif
    5369
    5470class TComSPSAccess // would be better to have a real SPS buffer
     
    113129  Void  destroy               ();
    114130
     131#if VIDYO_VPS_INTEGRATION
     132  Void  init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess );
     133#endif
    115134  Void  init                  ( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess );
    116135  Void  uninit                ();
     
    136155
    137156  TComPrediction*   getPrediction ()  { return m_pcPrediction;  }
     157#if VIDYO_VPS_INTEGRATION
     158  TComVPSAccess*    getVPSAccess  ()  { return m_pcVPSAccess;   }
     159#endif
    138160  TComSPSAccess*    getSPSAccess  ()  { return m_pcSPSAccess;   }
    139161  TComAUPicAccess*  getAUPicAccess()  { return m_pcAUPicAccess; }
     
    198220  Bool              m_bDecoder;
    199221  TComPrediction*   m_pcPrediction;
     222#if VIDYO_VPS_INTEGRATION
     223  TComVPSAccess*    m_pcVPSAccess;
     224#endif
    200225  TComSPSAccess*    m_pcSPSAccess;
    201226  TComAUPicAccess*  m_pcAUPicAccess;
  • branches/HTM-3.0-Vidyo/source/Lib/TLibCommon/TComPic.h

    r56 r71  
    120120  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
    121121  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
     122#if VIDYO_VPS_INTEGRATION
     123  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
     124#endif
    122125  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
    123126  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
  • branches/HTM-3.0-Vidyo/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r70 r71  
    13491349  READ_FLAG( uiCode,  "temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    13501350  READ_UVLC( uiCode,  "video_parameter_set_id" );         pcVPS->setVPSId( uiCode );
    1351   for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
     1351  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
    13521352  {
    13531353    READ_UVLC( uiCode,  "max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
     
    13621362    READ_UVLC( uiCode,  "extension_type" );               pcVPS->setExtensionType( uiCode );
    13631363   
    1364     if( pcVPS->getExtensionType() == 0)
    1365       READ_SVLC( iCode,  "view_order_idx[0]" );           pcVPS->setViewOrderIdx( iCode, 0 );
    1366    
    1367     for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     1364    pcVPS->setViewOrderIdx( 0, 0 );
     1365    pcVPS->setViewId( 0, 0 );
     1366    pcVPS->setDepthFlag( 0, 0 );
     1367    for(UInt i = 1; i <= pcVPS->getMaxLayers()-1; i++)
    13681368    {
    13691369      READ_FLAG( uiCode, "dependent_flag[i]" );           pcVPS->setDependentFlag( uiCode ? true:false, i);
  • branches/HTM-3.0-Vidyo/source/Lib/TLibDecoder/TDecTop.cpp

    r70 r71  
    319319  m_tAppDecTop = pcTAppDecTop;
    320320#if DEPTH_MAP_GENERATION
     321#if VIDYO_VPS_INTEGRATION
     322  m_cDepthMapGenerator.init( &m_cPrediction, m_tAppDecTop->getVPSAccess(), m_tAppDecTop->getSPSAccess(), m_tAppDecTop->getAUPicAccess() );
     323#else
    321324  m_cDepthMapGenerator.init( &m_cPrediction, m_tAppDecTop->getSPSAccess(), m_tAppDecTop->getAUPicAccess() );
     325#endif
    322326#endif
    323327#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    574578  TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
    575579  assert (vps != 0);
     580  if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )
     581    // VPS can only be activated on IDR or CRA...
     582    getTAppDecTop()->getVPSAccess()->setActiveVPSId( sps->getVPSId() );
    576583#endif
    577584  m_apcSlicePilot->setPPS(pps);
     
    10821089  m_cEntropyDecoder.decodeVPS( vps );
    10831090  m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 
    1084 
     1091  getTAppDecTop()->getVPSAccess()->addVPS( vps );
    10851092}
    10861093#endif
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCavlc.cpp

    r70 r71  
    395395    WRITE_UVLC( pcVPS->getExtensionType(),                        "extension_type" );
    396396   
    397     if( pcVPS->getExtensionType() == 0)
    398       WRITE_SVLC( pcVPS->getViewOrderIdx(0),                      "view_order_idx[0]" );
    399    
    400     for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     397    for(UInt i=1; i <= pcVPS->getMaxLayers()-1; i++)
    401398    {
    402399      WRITE_FLAG( pcVPS->getDependentFlag(i),                     "dependent_flag[i]" );
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncGOP.cpp

    r70 r71  
    246246
    247247      std::vector<TComAPS>& vAPS = m_pcEncTop->getAPS();
     248#if VIDYO_VPS_INTEGRATION
     249    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     250#else
    248251      m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
     252#endif
    249253      pcSlice->setLastIDR(m_iLastIDR);
    250254      pcSlice->setSliceIdx(0);
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSlice.cpp

    r56 r71  
    161161 \param pPPS          PPS associated with the slice
    162162 */
     163#if VIDYO_VPS_INTEGRATION
     164Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS )
     165#else
    163166Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS )
     167#endif
    164168{
    165169  Double dQP;
     
    167171 
    168172  rpcSlice = pcPic->getSlice(0);
     173#if VIDYO_VPS_INTEGRATION
     174  rpcSlice->setVPS( pVPS );
     175#endif
    169176  rpcSlice->setSPS( pSPS );
    170177  rpcSlice->setPPS( pPPS );
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSlice.h

    r56 r71  
    110110 
    111111  /// preparation of slice encoding (reference marking, QP and lambda)
     112#if VIDYO_VPS_INTEGRATION
     113  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS );
     114#else
    112115  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS );
    113 
     116#endif
    114117  // compress and encode slice
    115118  Void    precompressSlice    ( TComPic*& rpcPic                                );      ///< precompress slice for multi-loop opt.
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncTop.cpp

    r56 r71  
    348348
    349349#if DEPTH_MAP_GENERATION
    350   m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() );
     350#if VIDYO_VPS_INTEGRATION
     351  m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() );
     352#else
     353  m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() );
     354#endif
    351355#endif
    352356#if HHI_INTER_VIEW_RESIDUAL_PRED
Note: See TracChangeset for help on using the changeset viewer.