当前位置: 首页>>代码示例>>Golang>>正文


Golang TComPic.GetNumCUsInFrame方法代码示例

本文整理汇总了Golang中gohm/TLibCommon.TComPic.GetNumCUsInFrame方法的典型用法代码示例。如果您正苦于以下问题:Golang TComPic.GetNumCUsInFrame方法的具体用法?Golang TComPic.GetNumCUsInFrame怎么用?Golang TComPic.GetNumCUsInFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gohm/TLibCommon.TComPic的用法示例。


在下文中一共展示了TComPic.GetNumCUsInFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: DecompressSlice


//.........这里部分代码省略.........
	uiWidthInLCUs := rpcPic.GetPicSym().GetFrameWidthInCU()
	//UInt uiHeightInLCUs = rpcPic.GetPicSym().GetFrameHeightInCU();
	uiCol := uint(0)
	uiLin := uint(0)
	uiSubStrm := uint(0)

	var uiTileCol, uiTileStartLCU, uiTileLCUX uint
	iNumSubstreamsPerTile := 1 // if independent.
	depSliceSegmentsEnabled := rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetPPS().GetDependentSliceSegmentsEnabledFlag()
	uiTileStartLCU = rpcPic.GetPicSym().GetTComTile(rpcPic.GetPicSym().GetTileIdxMap(iStartCUAddr)).GetFirstCUAddr()
	if depSliceSegmentsEnabled {
		if (!rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).IsNextSlice()) && iStartCUAddr != int(rpcPic.GetPicSym().GetTComTile(rpcPic.GetPicSym().GetTileIdxMap(iStartCUAddr)).GetFirstCUAddr()) {
			if pcSlice.GetPPS().GetEntropyCodingSyncEnabledFlag() {
				uiTileCol = rpcPic.GetPicSym().GetTileIdxMap(iStartCUAddr) % uint(rpcPic.GetPicSym().GetNumColumnsMinus1()+1)
				this.m_pcBufferSbacDecoders[uiTileCol].LoadContexts(this.CTXMem[1]) //2.LCU
				if (uint(iStartCUAddr)%uiWidthInLCUs + 1) >= uiWidthInLCUs {
					uiTileLCUX = uiTileStartLCU % uiWidthInLCUs
					uiCol = uint(iStartCUAddr) % uiWidthInLCUs
					if uiCol == uiTileLCUX {
						this.CTXMem[0].LoadContexts(pcSbacDecoder)
					}
				}
			}
			pcSbacDecoder.LoadContexts(this.CTXMem[0]) //end of depSlice-1
			pcSbacDecoders[uiSubStrm].LoadContexts(pcSbacDecoder)
		} else {
			if pcSlice.GetPPS().GetEntropyCodingSyncEnabledFlag() {
				this.CTXMem[1].LoadContexts(pcSbacDecoder)
			}
			this.CTXMem[0].LoadContexts(pcSbacDecoder)
		}
	}

	for iCUAddr := iStartCUAddr; uiIsLast == 0 && iCUAddr < int(rpcPic.GetNumCUsInFrame()); iCUAddr = int(rpcPic.GetPicSym().XCalculateNxtCUAddr(uint(iCUAddr))) {
		pcCU := rpcPic.GetCU(uint(iCUAddr))
		pcCU.InitCU(rpcPic, uint(iCUAddr))

		fmt.Printf("%d ", iCUAddr)

		//#ifdef ENC_DEC_TRACE
		pcSbacDecoder.XTraceLCUHeader(TLibCommon.TRACE_LCU)
		pcSbacDecoder.XReadAeTr(iCUAddr, "lcu_address", TLibCommon.TRACE_LCU)
		pcSbacDecoder.XReadAeTr(int(rpcPic.GetPicSym().GetTileIdxMap(iCUAddr)), "tile_id", TLibCommon.TRACE_LCU)
		//#endif

		uiTileCol = rpcPic.GetPicSym().GetTileIdxMap(int(iCUAddr)) % uint(rpcPic.GetPicSym().GetNumColumnsMinus1()+1) // what column of tiles are we in?
		uiTileStartLCU = rpcPic.GetPicSym().GetTComTile(rpcPic.GetPicSym().GetTileIdxMap(int(iCUAddr))).GetFirstCUAddr()
		uiTileLCUX = uiTileStartLCU % uiWidthInLCUs
		uiCol = uint(iCUAddr) % uiWidthInLCUs
		// The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture.
		uiLin = (uint(iCUAddr) / uiWidthInLCUs) - (uint(iStartCUAddr) / uiWidthInLCUs)
		// inherit from TR if necessary, select substream to use.

		if (pcSlice.GetPPS().GetNumSubstreams() > 1) || (depSliceSegmentsEnabled && (uiCol == uiTileLCUX) && (pcSlice.GetPPS().GetEntropyCodingSyncEnabledFlag())) {
			// independent tiles => substreams are "per tile".  iNumSubstreams has already been multiplied.
			iNumSubstreamsPerTile = iNumSubstreams / rpcPic.GetPicSym().GetNumTiles()
			uiSubStrm = rpcPic.GetPicSym().GetTileIdxMap(iCUAddr)*uint(iNumSubstreamsPerTile) + uiLin%uint(iNumSubstreamsPerTile)
			this.m_pcEntropyDecoder.SetBitstream(ppcSubstreams[uiSubStrm])
			// Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.

			if ((pcSlice.GetPPS().GetNumSubstreams() > 1) || depSliceSegmentsEnabled) && (uiCol == uiTileLCUX) && (pcSlice.GetPPS().GetEntropyCodingSyncEnabledFlag()) {
				// We'll sync if the TR is available.
				pcCUUp := pcCU.GetCUAbove()
				uiWidthInCU := rpcPic.GetFrameWidthInCU()
				var pcCUTR *TLibCommon.TComDataCU
				if pcCUUp != nil && ((uint(iCUAddr)%uiWidthInCU + 1) < uiWidthInCU) {
开发者ID:nacore,项目名称:GoHM,代码行数:67,代码来源:TDecSlice.go

示例2: FilterPicture

func (this *TDecGop) FilterPicture(rpcPic *TLibCommon.TComPic) {
	pcSlice := rpcPic.GetSlice(rpcPic.GetCurrSliceIdx())

	//-- For time output for each slice
	iBeforeTime := time.Now()

	// deblocking filter
	bLFCrossTileBoundary := pcSlice.GetPPS().GetLoopFilterAcrossTilesEnabledFlag()
	this.m_pcLoopFilter.SetCfg(bLFCrossTileBoundary)
	this.m_pcLoopFilter.LoopFilterPic(rpcPic)

	if pcSlice.GetSPS().GetUseSAO() {
		l := len(this.m_sliceStartCUAddress)
		this.m_sliceStartCUAddress[l] = int(rpcPic.GetNumCUsInFrame() * rpcPic.GetNumPartInCU())
		///this.m_sliceStartCUAddress.PushBack(rpcPic.GetNumCUsInFrame()* rpcPic.GetNumPartInCU());
		rpcPic.CreateNonDBFilterInfo(this.m_sliceStartCUAddress, 0, this.m_LFCrossSliceBoundaryFlag, rpcPic.GetPicSym().GetNumTiles(), bLFCrossTileBoundary)
	}

	if pcSlice.GetSPS().GetUseSAO() {
		saoParam := rpcPic.GetPicSym().GetSaoParam()
		saoParam.SaoFlag[0] = pcSlice.GetSaoEnabledFlag()
		saoParam.SaoFlag[1] = pcSlice.GetSaoEnabledFlagChroma()
		this.m_pcSAO.SetSaoLcuBasedOptimization(true)
		this.m_pcSAO.CreatePicSaoInfo(rpcPic) //, len(this.m_sliceStartCUAddress)-1)
		this.m_pcSAO.SAOProcess(saoParam)
		this.m_pcSAO.PCMLFDisableProcess(rpcPic)
		this.m_pcSAO.DestroyPicSaoInfo()
	}

	if pcSlice.GetSPS().GetUseSAO() {
		rpcPic.DestroyNonDBFilterInfo()
	}

	rpcPic.CompressMotion()

	//this.DumpMotionField(rpcPic);

	var c string

	if pcSlice.IsIntra() {
		c = "I"
	} else if pcSlice.IsInterP() {
		if pcSlice.IsReferenced() {
			c = "P"
		} else {
			c = "p"
		}
	} else {
		if pcSlice.IsReferenced() {
			c = "B"
		} else {
			c = "b"
		}
	}

	//-- For time output for each slice
	fmt.Printf("\nPOC %4d TId: %1d ( %s-SLICE, QP%3d ) ", pcSlice.GetPOC(), pcSlice.GetTLayer(), c, pcSlice.GetSliceQp())

	this.m_dDecTime += time.Now().Sub(iBeforeTime)
	fmt.Printf("[DT %10v] ", this.m_dDecTime)
	this.m_dDecTime = 0

	for iRefList := 0; iRefList < 2; iRefList++ {
		fmt.Printf("[L%d ", iRefList)
		for iRefIndex := 0; iRefIndex < pcSlice.GetNumRefIdx(TLibCommon.RefPicList(iRefList)); iRefIndex++ {
			fmt.Printf("%d ", pcSlice.GetRefPOC(TLibCommon.RefPicList(iRefList), iRefIndex))
		}
		fmt.Printf("] ")
	}
	if this.m_decodedPictureHashSEIEnabled > 0 {
		this.CalcAndPrintHashStatus(rpcPic.GetPicYuvRec(), rpcPic.GetSEIs())
	}

	rpcPic.SetOutputMark(true)
	rpcPic.SetReconMark(true)

	//this.m_sliceStartCUAddress.Init();
	//this.m_LFCrossSliceBoundaryFlag.Init();
	slicesize := len(this.m_sliceStartCUAddress)

	for i := 0; i < slicesize; i++ {
		delete(this.m_sliceStartCUAddress, i)
	}
	if len(this.m_sliceStartCUAddress) != 0 {
		fmt.Printf("clear this.m_sliceStartCUAddress error\n")
	}

	lfsize := len(this.m_LFCrossSliceBoundaryFlag)

	for i := 0; i < lfsize; i++ {
		delete(this.m_LFCrossSliceBoundaryFlag, i)
	}
	if len(this.m_LFCrossSliceBoundaryFlag) != 0 {
		fmt.Printf("clear this.m_LFCrossSliceBoundaryFlag error\n")
	}
}
开发者ID:nacore,项目名称:GoHM,代码行数:96,代码来源:TDecGop.go


注:本文中的gohm/TLibCommon.TComPic.GetNumCUsInFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。