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


Golang TComDataCU.GetAddr方法代码示例

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


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

示例1: DecompressSlice


//.........这里部分代码省略.........
		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) {
					pcCUTR = rpcPic.GetCU(uint(iCUAddr) - uiWidthInCU + 1)
				}
				uiMaxParts := uint(1 << (pcSlice.GetSPS().GetMaxCUDepth() << 1))

				if true && //bEnforceSliceRestriction
					((pcCUTR == nil) || (pcCUTR.GetSlice() == nil) ||
						((pcCUTR.GetSCUAddr() + uiMaxParts - 1) < pcSlice.GetSliceCurStartCUAddr()) ||
						(rpcPic.GetPicSym().GetTileIdxMap(int(pcCUTR.GetAddr())) != rpcPic.GetPicSym().GetTileIdxMap(iCUAddr))) {

					// TR not available.
				} else {
					// TR is available, we use it.
					pcSbacDecoders[uiSubStrm].LoadContexts(this.m_pcBufferSbacDecoders[uiTileCol])
				}
			}
			pcSbacDecoder.Load(pcSbacDecoders[uiSubStrm]) //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
		} else if pcSlice.GetPPS().GetNumSubstreams() <= 1 {
			// Set variables to appropriate values to avoid later code change.
			iNumSubstreamsPerTile = 1
		}

		if (uint(iCUAddr) == rpcPic.GetPicSym().GetTComTile(rpcPic.GetPicSym().GetTileIdxMap(iCUAddr)).GetFirstCUAddr()) && // 1st in tile.
			(iCUAddr != 0) && (uint(iCUAddr) != rpcPic.GetPicSym().GetPicSCUAddr(rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceCurStartCUAddr())/rpcPic.GetNumPartInCU()) &&
			(uint(iCUAddr) != rpcPic.GetPicSym().GetPicSCUAddr(rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceSegmentCurStartCUAddr())/rpcPic.GetNumPartInCU()) {
			// !1st in frame && !1st in slice
			if pcSlice.GetPPS().GetNumSubstreams() > 1 {
				// We're crossing into another tile, tiles are independent.
				// When tiles are independent, we have "substreams per tile".  Each substream has already been terminated, and we no longer
				// have to perform it here.
				// For TILES_DECODER, there can be a header at the start of the 1st substream in a tile.  These are read when the substreams
				// are extracted, not here.
			} else {
				sliceType := pcSlice.GetSliceType()
				if pcSlice.GetCabacInitFlag() {
					switch sliceType {
					case TLibCommon.P_SLICE: // change initialization table to B_SLICE intialization
						sliceType = TLibCommon.B_SLICE
						//break;
					case TLibCommon.B_SLICE: // change initialization table to P_SLICE intialization
						sliceType = TLibCommon.P_SLICE
开发者ID:nacore,项目名称:GoHM,代码行数:67,代码来源:TDecSlice.go


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