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


Golang TComDataCU.GetMergeIndex1方法代码示例

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


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

示例1: DecodePUWise

func (this *TDecEntropy) DecodePUWise(pcCU *TLibCommon.TComDataCU, uiAbsPartIdx, uiDepth uint, pcSubCU *TLibCommon.TComDataCU) {
	ePartSize := pcCU.GetPartitionSize1(uiAbsPartIdx)
	var uiNumPU uint
	if ePartSize == TLibCommon.SIZE_2Nx2N {
		uiNumPU = 1
	} else if ePartSize == TLibCommon.SIZE_NxN {
		uiNumPU = 4
	} else {
		uiNumPU = 2
	}

	uiPUOffset := (TLibCommon.G_auiPUOffset[uint(ePartSize)] << ((pcCU.GetSlice().GetSPS().GetMaxCUDepth() - uiDepth) << 1)) >> 4

	var cMvFieldNeighbours [TLibCommon.MRG_MAX_NUM_CANDS << 1]TLibCommon.TComMvField // double length for mv of both lists
	var uhInterDirNeighbours [TLibCommon.MRG_MAX_NUM_CANDS]byte

	for ui := uint(0); ui < pcCU.GetSlice().GetMaxNumMergeCand(); ui++ {
		uhInterDirNeighbours[ui] = 0
	}
	numValidMergeCand := 0
	isMerged := false

	pcSubCU.CopyInterPredInfoFrom(pcCU, uiAbsPartIdx, TLibCommon.REF_PIC_LIST_0)
	pcSubCU.CopyInterPredInfoFrom(pcCU, uiAbsPartIdx, TLibCommon.REF_PIC_LIST_1)
	uiSubPartIdx := uiAbsPartIdx
	for uiPartIdx := uint(0); uiPartIdx < uiNumPU; uiPartIdx++ {
		this.DecodeMergeFlag(pcCU, uiSubPartIdx, uiDepth, uiPartIdx)
		if pcCU.GetMergeFlag1(uiSubPartIdx) {
			this.DecodeMergeIndex(pcCU, uiPartIdx, uiSubPartIdx, uiDepth)
			uiMergeIndex := pcCU.GetMergeIndex1(uiSubPartIdx)
			if pcCU.GetSlice().GetPPS().GetLog2ParallelMergeLevelMinus2() != 0 && ePartSize != TLibCommon.SIZE_2Nx2N && pcSubCU.GetWidth1(0) <= 8 {
				pcSubCU.SetPartSizeSubParts(TLibCommon.SIZE_2Nx2N, 0, uiDepth)
				if !isMerged {
					pcSubCU.GetInterMergeCandidates(0, 0, cMvFieldNeighbours[:], uhInterDirNeighbours[:], &numValidMergeCand, -1)
					isMerged = true
				}
				pcSubCU.SetPartSizeSubParts(ePartSize, 0, uiDepth)
			} else {
				uiMergeIndex = pcCU.GetMergeIndex1(uiSubPartIdx)
				pcSubCU.GetInterMergeCandidates(uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours[:], uhInterDirNeighbours[:], &numValidMergeCand, int(uiMergeIndex))
			}
			pcCU.SetInterDirSubParts(uint(uhInterDirNeighbours[uiMergeIndex]), uiSubPartIdx, uiPartIdx, uiDepth)

			cTmpMv := TLibCommon.NewTComMv(0, 0)
			for uiRefListIdx := 0; uiRefListIdx < 2; uiRefListIdx++ {
				if pcCU.GetSlice().GetNumRefIdx(TLibCommon.RefPicList(uiRefListIdx)) > 0 {
					pcCU.SetMVPIdxSubParts(0, TLibCommon.RefPicList(uiRefListIdx), uiSubPartIdx, uiPartIdx, uiDepth)
					pcCU.SetMVPNumSubParts(0, TLibCommon.RefPicList(uiRefListIdx), uiSubPartIdx, uiPartIdx, uiDepth)
					pcCU.GetCUMvField(TLibCommon.RefPicList(uiRefListIdx)).SetAllMvd(*cTmpMv, ePartSize, int(uiSubPartIdx), uiDepth, int(uiPartIdx))
					pcCU.GetCUMvField(TLibCommon.RefPicList(uiRefListIdx)).SetAllMvField(&cMvFieldNeighbours[2*int(uiMergeIndex)+uiRefListIdx], ePartSize, int(uiSubPartIdx), uiDepth, int(uiPartIdx))
				}
			}
		} else {
			this.DecodeInterDirPU(pcCU, uiSubPartIdx, uiDepth, uiPartIdx)
			for uiRefListIdx := 0; uiRefListIdx < 2; uiRefListIdx++ {
				if pcCU.GetSlice().GetNumRefIdx(TLibCommon.RefPicList(uiRefListIdx)) > 0 {
					//fmt.Printf("%d \n",uiRefListIdx);
					this.DecodeRefFrmIdxPU(pcCU, uiSubPartIdx, uiDepth, uiPartIdx, TLibCommon.RefPicList(uiRefListIdx))
					this.DecodeMvdPU(pcCU, uiSubPartIdx, uiDepth, uiPartIdx, TLibCommon.RefPicList(uiRefListIdx))
					this.DecodeMVPIdxPU(pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, TLibCommon.RefPicList(uiRefListIdx))
				}
			}
		}
		if (pcCU.GetInterDir1(uiSubPartIdx) == 3) && pcSubCU.IsBipredRestriction(uiPartIdx) {
			pcCU.GetCUMvField(TLibCommon.REF_PIC_LIST_1).SetAllMv(*TLibCommon.NewTComMv(0, 0), ePartSize, int(uiSubPartIdx), uiDepth, int(uiPartIdx))
			pcCU.GetCUMvField(TLibCommon.REF_PIC_LIST_1).SetAllRefIdx(-1, ePartSize, int(uiSubPartIdx), uiDepth, int(uiPartIdx))
			pcCU.SetInterDirSubParts(1, uiSubPartIdx, uiPartIdx, uiDepth)
		}

		uiSubPartIdx += uiPUOffset
	}
	return
}
开发者ID:hanjinze,项目名称:GoHM,代码行数:73,代码来源:TDecEntropy.go


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