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


Golang TComPic.GetFrameWidthInCU方法代码示例

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


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

示例1: DecompressSlice

func (this *TDecSlice) DecompressSlice(ppcSubstreams []*TLibCommon.TComInputBitstream, rpcPic *TLibCommon.TComPic, pcSbacDecoder *TDecSbac, pcSbacDecoders []*TDecSbac) {
	//var pcCU *TLibCommon.TComDataCU;
	uiIsLast := uint(0)
	var iStartCUEncOrder uint
	if rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceCurStartCUAddr()/rpcPic.GetNumPartInCU() > rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceSegmentCurStartCUAddr()/rpcPic.GetNumPartInCU() {
		iStartCUEncOrder = rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceCurStartCUAddr() / rpcPic.GetNumPartInCU()
	} else {
		iStartCUEncOrder = rpcPic.GetSlice(rpcPic.GetCurrSliceIdx()).GetSliceSegmentCurStartCUAddr() / rpcPic.GetNumPartInCU()
	}
	iStartCUAddr := int(rpcPic.GetPicSym().GetCUOrderMap(int(iStartCUEncOrder)))

	// decoder don't need prediction & residual frame buffer
	rpcPic.SetPicYuvPred(nil)
	rpcPic.SetPicYuvResi(nil)

	//#if ENC_DEC_TRACE
	//  g_bJustDoIt = g_bEncDecTraceEnable;
	//#endif
	//  DTRACE_CABAC_VL( g_nSymbolCounter++ );
	//  DTRACE_CABAC_T( "\tPOC: " );
	//  DTRACE_CABAC_V( rpcPic.GetPOC() );
	//  DTRACE_CABAC_T( "\n" );
	//#if ENC_DEC_TRACE
	//  g_bJustDoIt = g_bEncDecTraceDisable;
	//#endif

	uiTilesAcross := rpcPic.GetPicSym().GetNumColumnsMinus1() + 1
	pcSlice := rpcPic.GetSlice(rpcPic.GetCurrSliceIdx())
	iNumSubstreams := pcSlice.GetPPS().GetNumSubstreams()

	// delete decoders if already allocated in previous slice
	/*if (m_pcBufferSbacDecoders)
	  {
	    delete [] m_pcBufferSbacDecoders;
	  }
	  if (m_pcBufferBinCABACs)
	  {
	    delete [] m_pcBufferBinCABACs;
	  }*/
	// allocate new decoders based on tile numbaer
	this.m_pcBufferSbacDecoders = make([]*TDecSbac, uiTilesAcross)
	this.m_pcBufferBinCABACs = make([]*TDecBinCabac, uiTilesAcross)
	for ui := 0; ui < uiTilesAcross; ui++ {
		this.m_pcBufferBinCABACs[ui] = NewTDecBinCabac()
		this.m_pcBufferSbacDecoders[ui] = NewTDecSbac()
		this.m_pcBufferSbacDecoders[ui].Init(this.m_pcBufferBinCABACs[ui])
	}
	//save init. state
	for ui := 0; ui < uiTilesAcross; ui++ {
		this.m_pcBufferSbacDecoders[ui].Load(pcSbacDecoder)
	}

	// free memory if already allocated in previous call
	/*if (this.m_pcBufferLowLatSbacDecoders)
	  {
	    delete [] this.m_pcBufferLowLatSbacDecoders;
	  }
	  if (this.m_pcBufferLowLatBinCABACs)
	  {
	    delete [] this.m_pcBufferLowLatBinCABACs;
	  }*/
	this.m_pcBufferLowLatSbacDecoders = make([]*TDecSbac, uiTilesAcross)
	this.m_pcBufferLowLatBinCABACs = make([]*TDecBinCabac, uiTilesAcross)
	for ui := 0; ui < uiTilesAcross; ui++ {
		this.m_pcBufferLowLatBinCABACs[ui] = NewTDecBinCabac()
		this.m_pcBufferLowLatSbacDecoders[ui] = NewTDecSbac()
		this.m_pcBufferLowLatSbacDecoders[ui].Init(this.m_pcBufferLowLatBinCABACs[ui])
	}
	//save init. state
	for ui := 0; ui < uiTilesAcross; ui++ {
		this.m_pcBufferLowLatSbacDecoders[ui].Load(pcSbacDecoder)
	}

	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() {
//.........这里部分代码省略.........
开发者ID:nacore,项目名称:GoHM,代码行数:101,代码来源:TDecSlice.go


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