Ignore:
Timestamp:
26 May 2016, 15:03:18 (9 years ago)
Author:
tech
Message:

Initial merge of HM-16.9.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-16.1-dev/source/Lib/TLibEncoder/TEncRateCtrl.cpp

    r1401 r1402  
    554554}
    555555
     556#if V0078_ADAPTIVE_LOWER_BOUND
     557Int TEncRCPic::xEstPicLowerBound(TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP)
     558{
     559  Int lowerBound = 0;
     560  Int GOPbitsLeft = encRCGOP->getBitsLeft();
     561
     562  const Int nextPicPosition = (encRCGOP->getNumPic() - encRCGOP->getPicLeft() + 1) % encRCGOP->getNumPic();
     563  const Int nextPicRatio = encRCSeq->getBitRatio(nextPicPosition);
     564
     565  Int totalPicRatio = 0;
     566  for (Int i = nextPicPosition; i < encRCGOP->getNumPic(); i++)
     567  {
     568    totalPicRatio += encRCSeq->getBitRatio(i);
     569  }
     570
     571  if (nextPicPosition == 0)
     572  {
     573    GOPbitsLeft = encRCGOP->getTargetBits();
     574  }
     575  else
     576  {
     577    GOPbitsLeft -= m_targetBits;
     578  }
     579
     580  lowerBound = Int(((Double)GOPbitsLeft) * nextPicRatio / totalPicRatio);
     581
     582  if (lowerBound < 100)
     583  {
     584    lowerBound = 100;   // at least allocate 100 bits for one picture
     585  }
     586
     587  if (m_encRCSeq->getFramesLeft() > 16)
     588  {
     589    lowerBound = Int(g_RCWeightPicRargetBitInBuffer * lowerBound + g_RCWeightPicTargetBitInGOP * m_encRCGOP->getTargetBitInGOP(nextPicPosition));
     590  }
     591
     592  return lowerBound;
     593}
     594#endif
     595
     596
    556597Void TEncRCPic::addToPictureLsit( list<TEncRCPic*>& listPreviousPictures )
    557598{
     
    611652  Int picWidthInLCU  = ( picWidth  % LCUWidth  ) == 0 ? picWidth  / LCUWidth  : picWidth  / LCUWidth  + 1;
    612653  Int picHeightInLCU = ( picHeight % LCUHeight ) == 0 ? picHeight / LCUHeight : picHeight / LCUHeight + 1;
     654#if V0078_ADAPTIVE_LOWER_BOUND
     655  m_lowerBound       = xEstPicLowerBound( encRCSeq, encRCGOP );
     656#endif
    613657
    614658  m_LCULeft         = m_numberOfLCU;
Note: See TracChangeset for help on using the changeset viewer.