HEVC代码追踪(三):encode->compressGOP

简介: <pre name="code" class="cpp">/** - Application has picture buffer list with size of GOP + 1 - Picture buffer list acts like as ring buffer - End of the list has the latest picture . \param
/**
 - Application has picture buffer list with size of GOP + 1
 - Picture buffer list acts like as ring buffer
 - End of the list has the latest picture
 .
 \param   flush               cause encoder to encode a partial GOP
 \param   pcPicYuvOrg         original YUV picture
 \retval  rcListPicYuvRecOut  list of reconstruction YUV pictures
 \retval  rcListBitstreamOut  list of output bitstreams
 \retval  iNumEncoded         number of encoded pictures
 */
Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded )
{
	if (pcPicYuvOrg) 
	{
		// get original YUV
		TComPic* pcPicCurr = NULL;
		xGetNewPicBuffer( pcPicCurr );
		pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );

		// compute image characteristics
		if ( getUseAdaptiveQP() )
		{
			m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) );
		}
	}
  
	if (!m_iNumPicRcvd || (!flush && m_iPOCLast != 0 && m_iNumPicRcvd != m_iGOPSize && m_iGOPSize))
	{
		iNumEncoded = 0;
		return;
	}
  
	if ( m_RCEnableRateControl )
	{
		m_cRateCtrl.initRCGOP( m_iNumPicRcvd );
	}

	// compress GOP

	m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, false, false);

	if ( m_RCEnableRateControl )
	{
		m_cRateCtrl.destroyRCGOP();
	}
  
	iNumEncoded         = m_iNumPicRcvd;
	m_iNumPicRcvd       = 0;
	m_uiNumAllPicCoded += iNumEncoded;
}

目录
相关文章
|
存储
LIO-SAM代码逐行解读(5)-点云匹配及后端优化模块
LIO-SAM代码逐行解读(5)-点云匹配及后端优化模块
907 0
VB编程:DataPart函数判断当前所处季节-46
VB编程:DataPart函数判断当前所处季节-46
155 0
VB编程:DataPart函数判断当前所处季节
VB编程:DataPart函数判断当前所处季节
324 0
VB编程:DataPart函数判断当前所处季节
|
编解码
HEVC代码追踪(十三):解码之decode
<p><br></p> <p></p> <pre name="code" class="cpp">// ==================================================================================================================== // Public member functions
1845 0
|
机器学习/深度学习 编解码
HEVC代码追踪(十二):解码之int main
<p><br></p> <p></p> <pre name="code" class="cpp">int main(int argc, char* argv[]) { TAppDecTop cTAppDecTop; // print information fprintf( stdout, "\n" ); fprintf( stdout, "HM software:
1176 0
HEVC代码追踪(十四):解码之xDecodeSlice
<p><br></p> <p></p> <pre name="code" class="cpp">Bool TDecTop::decode(InputNALUnit&amp; nalu, Int&amp; iSkipFrame, Int&amp; iPOCLastDisplay) { // Initialize entropy decoder m_cEntropyDecoder
2498 0
HEVC代码追踪(十五):解码之decompressSlice
<p><br></p> <p></p> <pre name="code" class="cpp">Void TDecGop::decompressSlice(TComInputBitstream* pcBitstream, TComPic*&amp; rpcPic) { TComSlice* pcSlice = rpcPic-&gt;getSlice(rpcPic-&gt;getC
1213 0
HEVC代码追踪(九):帧间-&gt;xCheckRDCostInter
<p><br></p> <p></p> <pre name="code" class="cpp">#if AMP_MRG Void TEncCu::xCheckRDCostInter( TComDataCU*&amp; rpcBestCU, TComDataCU*&amp; rpcTempCU, PartSize ePartSize, Bool bUseMRG) #else Void T
2247 0
HEVC代码追踪(八):帧内-&gt;xCheckRDCostIntra
<p><br></p> <p></p> <pre name="code" class="cpp">Void TEncCu::xCheckRDCostIntra( TComDataCU*&amp; rpcBestCU, TComDataCU*&amp; rpcTempCU, PartSize eSize ) { UInt uiDepth = rpcTempCU-&gt;getDepth
2733 0