Пример #1
0
func (this *TDecEntropy) DecodeMVPIdxPU(pcSubCU *TLibCommon.TComDataCU, uiPartAddr, uiDepth, uiPartIdx uint, eRefList TLibCommon.RefPicList) {
	iMVPIdx := -1

	cZeroMv := TLibCommon.NewTComMv(0, 0)
	cMv := cZeroMv
	iRefIdx := -1

	pcSubCUMvField := pcSubCU.GetCUMvField(eRefList)
	pAMVPInfo := pcSubCUMvField.GetAMVPInfo()

	iRefIdx = int(pcSubCUMvField.GetRefIdx(int(uiPartAddr)))
	cMv = cZeroMv

	if (pcSubCU.GetInterDir1(uiPartAddr) & (1 << eRefList)) != 0 {
		this.m_pcEntropyDecoderIf.ParseMVPIdx(&iMVPIdx)
	}
	pcSubCU.FillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo)
	pcSubCU.SetMVPNumSubParts(pAMVPInfo.IN, eRefList, uiPartAddr, uiPartIdx, uiDepth)
	pcSubCU.SetMVPIdxSubParts(iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth)
	if iRefIdx >= 0 {
		cMv = this.m_pcPrediction.GetMvPredAMVP(pcSubCU, uiPartIdx, uiPartAddr, eRefList)
		cMvd := pcSubCUMvField.GetMvd(int(uiPartAddr))
		//fmt.Printf("%d=(%d,%d)=(%d,%d)\n", iRefIdx, cMv.GetHor(), cMv.GetVer(), cMvd.GetHor(), cMvd.GetVer());
		cMv.Set(cMv.GetHor()+cMvd.GetHor(), cMv.GetVer()+cMvd.GetVer())
	}

	ePartSize := pcSubCU.GetPartitionSize1(uiPartAddr)
	pcSubCU.GetCUMvField(eRefList).SetAllMv(*cMv, ePartSize, int(uiPartAddr), 0, int(uiPartIdx))
	//fmt.Printf("%d(%d,%d)=%d,%d,%d",eRefList,cMv.GetHor(), cMv.GetVer(),ePartSize, uiPartAddr, uiPartIdx);
}