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;
}

目录
相关文章
|
编解码
HEVC代码追踪(十三):解码之decode
<p><br></p> <p></p> <pre name="code" class="cpp">// ==================================================================================================================== // Public member functions
1794 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:
1152 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
2383 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
1187 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
2209 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
2676 0
HEVC代码追踪(二):encode
<pre name="code" class="cpp">// ==================================================================================================================== // Public member functions // =================
1631 0
|
内存技术
HEVC代码追踪(十):量化-&gt;xCheckIntraPCM
<p><br></p> <p></p> <pre name="code" class="cpp">/** Check R-D costs for a CU with PCM mode. * \param rpcBestCU pointer to best mode CU data structure * \param rpcTempCU pointer to testing mod
1448 0
HEVC代码追踪(八。二):estIntraPredChromaQT
<p><br></p> <p></p> <pre code_snippet_id="537345" snippet_file_name="blog_20141130_1_6232807" name="code" class="cpp">Void TEncSearch::estIntraPredChromaQT( TComDataCU* pcCU,
1679 0
HEVC代码追踪(七):xCompressCu
<p><br></p> <p></p> <pre name="code" class="cpp">// ==================================================================================================================== // Protected member functi
2604 0

热门文章

最新文章