Changeset 1405 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncTop.cpp


Ignore:
Timestamp:
27 May 2016, 17:32:40 (8 years ago)
Author:
tech
Message:

Merged HTM-16.1-dev@1404.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    144144      g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() );
    145145#else
    146     m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
    147         m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
     146    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, (Int)( (Double)m_iFrameRate/m_temporalSubsampleRatio + 0.5), m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
     147                      m_maxCUWidth, m_maxCUHeight,m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
    148148#endif
    149149  }
     
    951951  }
    952952
     953  if (getTemporalSubsampleRatio()>1)
     954  {
     955    UInt temporalSubsampleRatio = getTemporalSubsampleRatio();
     956    if ( Double(timingInfo->getNumUnitsInTick()) * temporalSubsampleRatio > std::numeric_limits<UInt>::max() )
     957    {
     958      timingInfo->setTimeScale( timingInfo->getTimeScale() / temporalSubsampleRatio );
     959    }
     960    else
     961    {
     962      timingInfo->setNumUnitsInTick( timingInfo->getNumUnitsInTick() * temporalSubsampleRatio );
     963    }
     964  }
     965
    953966  Bool rateCnt = ( bitRate > 0 );
    954967  hrd->setNalHrdParametersPresentFlag( rateCnt );
     
    11351148  m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset );
    11361149  m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
     1150#if W0038_CQP_ADJ
     1151  Bool bChromaDeltaQPEnabled = false;
     1152  {
     1153    bChromaDeltaQPEnabled = ( m_sliceChromaQpOffsetIntraOrPeriodic[0] || m_sliceChromaQpOffsetIntraOrPeriodic[1] );
     1154    if( !bChromaDeltaQPEnabled )
     1155    {
     1156      for( Int i=0; i<m_iGOPSize; i++ )
     1157      {
     1158        if( m_GOPList[i].m_CbQPoffset || m_GOPList[i].m_CrQPoffset )
     1159        {
     1160          bChromaDeltaQPEnabled = true;
     1161          break;
     1162        }
     1163      }
     1164    }
     1165  }
     1166  m_cPPS.setSliceChromaQpFlag(bChromaDeltaQPEnabled);
     1167#endif
    11371168
    11381169  m_cPPS.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
Note: See TracChangeset for help on using the changeset viewer.