Changeset 1544 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
22 Mar 2016, 23:36:21 (9 years ago)
Author:
seregin
Message:

port rev 4718 and remove TEMPORAL_SUBSAMPLE macro

Location:
branches/SHM-dev/source/Lib/TLibEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1538 r1544  
    103103  Int       m_iFrameRate;
    104104  Int       m_FrameSkip;
     105  UInt      m_temporalSubsampleRatio;
    105106  Int       m_iSourceWidth;
    106107  Int       m_iSourceHeight;
     
    509510
    510511  Void      setFrameRate                    ( Int   i )      { m_iFrameRate = i; }
    511   Void      setFrameSkip                    ( UInt i ) { m_FrameSkip = i; }
     512  Void      setFrameSkip                    ( UInt  i )      { m_FrameSkip = i; }
     513  Void      setTemporalSubsampleRatio       ( UInt  i )      { m_temporalSubsampleRatio = i; }
    512514  Void      setSourceWidth                  ( Int   i )      { m_iSourceWidth = i; }
    513515  Void      setSourceHeight                 ( Int   i )      { m_iSourceHeight = i; }
     
    610612  Int       getFrameRate                    ()      { return  m_iFrameRate; }
    611613  UInt      getFrameSkip                    ()      { return  m_FrameSkip; }
     614  UInt      getTemporalSubsampleRatio       ()      { return  m_temporalSubsampleRatio; }
    612615  Int       getSourceWidth                  ()      { return  m_iSourceWidth; }
    613616  Int       getSourceHeight                 ()      { return  m_iSourceHeight; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1542 r1544  
    28312831  //--CFG_KDY
    28322832  const Int rateMultiplier=(isField?2:1);
    2833   m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2834   m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2835   m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2836   m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
     2833  m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2834  m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2835  m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2836  m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
    28372837  const ChromaFormat chFmt = m_pcCfg->getChromaFormatIdc();
    28382838
     
    28652865  {
    28662866    //-- interlaced summary
    2867     m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate());
     2867    m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate() / (Double)m_pcCfg->getTemporalSubsampleRatio());
    28682868    m_gcAnalyzeAll_in.setBits(m_gcAnalyzeAll.getBits());
    28692869    // prior to the above statement, the interlace analyser does not contain the correct total number of bits.
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1534 r1544  
    135135  if ( m_RCEnableRateControl )
    136136  {
    137     m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
    138         m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
     137    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, (Int)( (Double)m_iFrameRate/m_temporalSubsampleRatio + 0.5), m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
     138                      m_maxCUWidth, m_maxCUHeight,m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
    139139  }
    140140
     
    11061106  }
    11071107
     1108  if (getTemporalSubsampleRatio()>1)
     1109  {
     1110    UInt temporalSubsampleRatio = getTemporalSubsampleRatio();
     1111    if ( Double(timingInfo->getNumUnitsInTick()) * temporalSubsampleRatio > std::numeric_limits<UInt>::max() )
     1112    {
     1113      timingInfo->setTimeScale( timingInfo->getTimeScale() / temporalSubsampleRatio );
     1114    }
     1115    else
     1116    {
     1117      timingInfo->setNumUnitsInTick( timingInfo->getNumUnitsInTick() * temporalSubsampleRatio );
     1118    }
     1119  }
     1120
    11081121  Bool rateCnt = ( bitRate > 0 );
    11091122  hrd->setNalHrdParametersPresentFlag( rateCnt );
Note: See TracChangeset for help on using the changeset viewer.