Changeset 1386 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp
- Timestamp:
- 13 Nov 2015, 16:29:39 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r1313 r1386 1639 1639 m_encRCSeq->initLCUPara(); 1640 1640 } 1641 #if U0132_TARGET_BITS_SATURATION 1642 m_CpbSaturationEnabled = false; 1643 m_cpbSize = targetBitrate; 1644 m_cpbState = (UInt)(m_cpbSize*0.5f); 1645 m_bufferingRate = (Int)(targetBitrate / frameRate); 1646 #endif 1641 1647 1642 1648 #if KWU_RC_MADPRED_E0227 … … 1664 1670 } 1665 1671 1672 #if U0132_TARGET_BITS_SATURATION 1673 Int TEncRateCtrl::updateCpbState(Int actualBits) 1674 { 1675 Int cpbState = 1; 1676 1677 m_cpbState -= actualBits; 1678 if (m_cpbState < 0) 1679 { 1680 cpbState = -1; 1681 } 1682 1683 m_cpbState += m_bufferingRate; 1684 if (m_cpbState > m_cpbSize) 1685 { 1686 cpbState = 0; 1687 } 1688 1689 return cpbState; 1690 } 1691 1692 Void TEncRateCtrl::initHrdParam(const TComHRD* pcHrd, Int iFrameRate, Double fInitialCpbFullness) 1693 { 1694 m_CpbSaturationEnabled = true; 1695 m_cpbSize = (pcHrd->getCpbSizeValueMinus1(0, 0, 0) + 1) << (4 + pcHrd->getCpbSizeScale()); 1696 m_cpbState = (UInt)(m_cpbSize*fInitialCpbFullness); 1697 m_bufferingRate = (UInt)(((pcHrd->getBitRateValueMinus1(0, 0, 0) + 1) << (6 + pcHrd->getBitRateScale())) / iFrameRate); 1698 printf("\nHRD - [Initial CPB state %6d] [CPB Size %6d] [Buffering Rate %6d]\n", m_cpbState, m_cpbSize, m_bufferingRate); 1699 } 1700 #endif 1701 1666 1702 Void TEncRateCtrl::destroyRCGOP() 1667 1703 {
Note: See TracChangeset for help on using the changeset viewer.