Changeset 296 in SHVCSoftware for branches/SHM-2.1-dev/source/App/TAppEncoder


Ignore:
Timestamp:
20 Jun 2013, 17:44:29 (12 years ago)
Author:
nokia
Message:

Implementation of JCTVC-M0040 "Adaptive Resolution Change"

Location:
branches/SHM-2.1-dev/source/App/TAppEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r294 r296  
    843843  ("ConstantPicRateIdc",           cfg_constantPicRateIdc,            string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0")
    844844#endif
     845#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     846  ("AdaptiveResolutionChange",     m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)")
     847#endif
    845848  ;
    846849 
     
    21372140  }
    21382141#endif
     2142#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     2143  if (m_adaptiveResolutionChange > 0)
     2144  {
     2145    xConfirmPara(m_numLayers != 2, "Adaptive resolution change works with 2 layers only");
     2146    xConfirmPara(m_acLayerCfg[1].m_iIntraPeriod == 0 || (m_adaptiveResolutionChange % m_acLayerCfg[1].m_iIntraPeriod) != 0, "Adaptive resolution change must happen at enhancement layer RAP picture");
     2147  }
     2148#endif
    21392149#undef xConfirmPara
    21402150  if (check_failed)
     
    21752185  printf("Multiview                     : %d\n", m_scalabilityMask[0] );
    21762186  printf("Scalable                      : %d\n", m_scalabilityMask[1] );
     2187#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     2188  printf("Adaptive Resolution Change    : %d\n", m_adaptiveResolutionChange );
     2189#endif
    21772190  for(UInt layer=0; layer<m_numLayers; layer++)
    21782191  {
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h

    r292 r296  
    369369  Int*      m_constantPicRateIdc;                                ///< Indicates constant picture rate idc for various sub-layers
    370370#endif
     371#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     372  Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
     373#endif
    371374public:
    372375  TAppEncCfg();
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r292 r296  
    515515    }
    516516#endif
     517#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     518    m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange );
     519#endif
    517520  }
    518521}
     
    10311034    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
    10321035#endif
     1036#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1037  vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false);
     1038#endif
    10331039#else
    10341040  m_cTEncTop.init();
     
    11501156#endif
    11511157
     1158#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1159    if (m_adaptiveResolutionChange)
     1160    {
     1161      for(UInt layer = 0; layer < m_numLayers; layer++)
     1162      {
     1163        TComList<TComPicYuv*>::iterator iterPicYuvRec;
     1164        for (iterPicYuvRec = m_acListPicYuvRec[layer].begin(); iterPicYuvRec != m_acListPicYuvRec[layer].end(); iterPicYuvRec++)
     1165        {
     1166          TComPicYuv* recPic = *(iterPicYuvRec);
     1167          recPic->setReconstructed(false);
     1168        }
     1169      }
     1170    }
     1171#endif
     1172
    11521173    // loop through frames in one GOP
    11531174    for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ )
     
    14161437  {
    14171438    TComPicYuv*  pcPicYuvRec  = *(iterPicYuvRec++);
     1439#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1440    if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed())
     1441#else
    14181442    if (!m_acLayerCfg[layer].getReconFile().empty())
     1443#endif
    14191444    {
    14201445      m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(),
     
    14301455  list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin();
    14311456
     1457#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1458  for ( i = 0; i < iNumEncoded && iterBitstream != accessUnits.end(); i++ )
     1459#else
    14321460  for ( i = 0; i < iNumEncoded; i++ )
     1461#endif
    14331462  {
    14341463    const AccessUnit& au = *(iterBitstream++);
Note: See TracChangeset for help on using the changeset viewer.