Esempio n. 1
0
// -------------------------------------------------------------------------------------------------------------------
// member access functions
// -------------------------------------------------------------------------------------------------------------------
func (this *TEncTop) xGetNewPicBuffer() *TLibCommon.TComPic { ///< get picture buffer which will be processed
	var rpcPic *TLibCommon.TComPic

	TLibCommon.SortPicList(this.m_cListPic)

	if this.m_cListPic.Len() >= (this.GetEncCfg().m_iGOPSize + this.GetEncCfg().GetMaxDecPicBuffering(TLibCommon.MAX_TLAYER-1) + 2) {

		//Int iSize = Int( this.m_cListPic.size() );
		for iterPic := this.m_cListPic.Front(); iterPic != nil; iterPic = iterPic.Next() {
			rpcPic = iterPic.Value.(*TLibCommon.TComPic)

			if rpcPic.GetSlice(0).IsReferenced() == false {
				break
			}
		}
	} else {
		if this.GetEncCfg().GetUseAdaptiveQP() {
			pcEPic := TLibCommon.NewTComPic()
			pcEPic.Create(this.GetEncCfg().m_iSourceWidth, this.GetEncCfg().m_iSourceHeight,
				TLibCommon.G_uiMaxCUWidth, TLibCommon.G_uiMaxCUHeight, TLibCommon.G_uiMaxCUDepth, this.m_cPPS.GetMaxCuDQPDepth()+1,
				this.GetEncCfg().m_conformanceWindow, this.GetEncCfg().m_defaultDisplayWindow, this.GetEncCfg().m_numReorderPics[:], false)
			rpcPic = pcEPic
		} else {
			rpcPic = TLibCommon.NewTComPic()
			rpcPic.Create(this.GetEncCfg().m_iSourceWidth, this.GetEncCfg().m_iSourceHeight,
				TLibCommon.G_uiMaxCUWidth, TLibCommon.G_uiMaxCUHeight, TLibCommon.G_uiMaxCUDepth, 0,
				this.GetEncCfg().m_conformanceWindow, this.GetEncCfg().m_defaultDisplayWindow, this.GetEncCfg().m_numReorderPics[:], false)
		}
		if this.GetEncCfg().GetUseSAO() {
			fmt.Printf("not support SAO\n")
			//rpcPic.GetPicSym().AllocSaoParam(this.m_cEncSAO);
		}
		this.m_cListPic.PushBack(rpcPic)
	}
	rpcPic.SetReconMark(false)

	this.m_iPOCLast++
	this.m_iNumPicRcvd++

	rpcPic.GetSlice(0).SetPOC(this.m_iPOCLast)
	// mark it should be extended
	rpcPic.GetPicYuvRec().SetBorderExtension(false)

	return rpcPic
}
Esempio n. 2
0
func (this *TDecTop) ExecuteLoopFilters(poc *int, bSkipPictureForBLA bool) *list.List {
	if this.m_pcPic == nil || bSkipPictureForBLA {
		/* nothing to deblock */
		return this.m_pcListPic
	}

	//pcPic := this.m_pcPic

	// Execute Deblock + Cleanup
	this.m_cGopDecoder.FilterPicture(this.m_pcPic)

	TLibCommon.SortPicList(this.m_pcListPic) // sorting for application output
	*poc = this.m_pcPic.GetSlice(this.m_uiSliceIdx - 1).GetPOC()
	this.m_cCuDecoder.Destroy()
	this.m_bFirstSliceInPicture = true

	return this.m_pcListPic
}