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


Golang TComDataCU.GetCoeffCb方法代码示例

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


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

示例1: xDecodeTransform


//.........这里部分代码省略.........
	if uiSubdiv != 0 {
		var size uint
		width >>= 1
		height >>= 1
		size = width * height
		uiTrIdx++
		uiDepth++
		uiQPartNum := pcCU.GetPic().GetNumPartInCU() >> (uiDepth << 1)
		uiStartAbsPartIdx := uiAbsPartIdx
		uiYCbf := uint(0)
		uiUCbf := uint(0)
		uiVCbf := uint(0)

		for i := uint(0); i < 4; i++ {
			this.xDecodeTransform(pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP)
			uiYCbf |= uint(pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_LUMA, uiTrDepth+1))
			uiUCbf |= uint(pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, uiTrDepth+1))
			uiVCbf |= uint(pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, uiTrDepth+1))
			uiAbsPartIdx += uiQPartNum
			offsetLuma += size
			offsetChroma += (size >> 2)
		}

		for ui := uint(0); ui < 4*uiQPartNum; ui++ {
			pcCU.GetCbf1(TLibCommon.TEXT_LUMA)[uiStartAbsPartIdx+ui] |= byte(uiYCbf << uiTrDepth)
			pcCU.GetCbf1(TLibCommon.TEXT_CHROMA_U)[uiStartAbsPartIdx+ui] |= byte(uiUCbf << uiTrDepth)
			pcCU.GetCbf1(TLibCommon.TEXT_CHROMA_V)[uiStartAbsPartIdx+ui] |= byte(uiVCbf << uiTrDepth)
		}
	} else {
		//assert( uiDepth >= pcCU.GetDepth( uiAbsPartIdx ) );
		pcCU.SetTrIdxSubParts(uiTrDepth, uiAbsPartIdx, uiDepth)

		{
			//DTRACE_CABAC_VL( TLibCommon.G_nSymbolCounter++ );
			/*this.m_pcEntropyDecoderIf.DTRACE_CABAC_T("\tTrIdx: abspart=")
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_V(uiAbsPartIdx)
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_T("\tdepth=")
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_V(uiDepth)
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_T("\ttrdepth=")
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_V(uiTrDepth)
			  this.m_pcEntropyDecoderIf.DTRACE_CABAC_T("\n")*/
		}

		pcCU.SetCbfSubParts4(0, TLibCommon.TEXT_LUMA, uiAbsPartIdx, uiDepth)
		if pcCU.GetPredictionMode1(uiAbsPartIdx) != TLibCommon.MODE_INTRA && uiDepth == uint(pcCU.GetDepth1(uiAbsPartIdx)) && pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, 0) == 0 && pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, 0) == 0 {
			pcCU.SetCbfSubParts4(1<<uiTrDepth, TLibCommon.TEXT_LUMA, uiAbsPartIdx, uiDepth)
		} else {
			this.m_pcEntropyDecoderIf.ParseQtCbf(pcCU, uiAbsPartIdx, TLibCommon.TEXT_LUMA, uiTrDepth, uiDepth)
		}

		// transforthis.m_unit begin
		cbfY := pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_LUMA, uiTrIdx)
		cbfU := pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, uiTrIdx)
		cbfV := pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, uiTrIdx)
		if uiLog2TrafoSize == 2 {
			partNum := pcCU.GetPic().GetNumPartInCU() >> ((uiDepth - 1) << 1)
			if (uiAbsPartIdx % partNum) == (partNum - 1) {
				cbfU = pcCU.GetCbf3(this.m_uiBakAbsPartIdx, TLibCommon.TEXT_CHROMA_U, uiTrIdx)
				cbfV = pcCU.GetCbf3(this.m_uiBakAbsPartIdx, TLibCommon.TEXT_CHROMA_V, uiTrIdx)
			}
		}
		if cbfY != 0 || cbfU != 0 || cbfV != 0 {
			// dQP: only for LCU
			if pcCU.GetSlice().GetPPS().GetUseDQP() {
				if *bCodeDQP {
					this.DecodeQP(pcCU, this.m_bakAbsPartIdxCU)
					*bCodeDQP = false
				}
			}
		}
		if cbfY != 0 {
			trWidth := width
			trHeight := height
			this.m_pcEntropyDecoderIf.ParseCoeffNxN(pcCU, pcCU.GetCoeffY()[offsetLuma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_LUMA)
		}
		if uiLog2TrafoSize > 2 {
			trWidth := width >> 1
			trHeight := height >> 1
			if cbfU != 0 {
				this.m_pcEntropyDecoderIf.ParseCoeffNxN(pcCU, pcCU.GetCoeffCb()[offsetChroma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_U)
			}
			if cbfV != 0 {
				this.m_pcEntropyDecoderIf.ParseCoeffNxN(pcCU, pcCU.GetCoeffCr()[offsetChroma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_V)
			}
		} else {
			partNum := pcCU.GetPic().GetNumPartInCU() >> ((uiDepth - 1) << 1)
			if (uiAbsPartIdx % partNum) == (partNum - 1) {
				trWidth := width
				trHeight := height
				if cbfU != 0 {
					this.m_pcEntropyDecoderIf.ParseCoeffNxN(pcCU, pcCU.GetCoeffCb()[this.m_uiBakChromaOffset:], this.m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_U)
				}
				if cbfV != 0 {
					this.m_pcEntropyDecoderIf.ParseCoeffNxN(pcCU, pcCU.GetCoeffCr()[this.m_uiBakChromaOffset:], this.m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_V)
				}
			}
		}
		// transform_unit end
	}
}
开发者ID:hanjinze,项目名称:GoHM,代码行数:101,代码来源:TDecEntropy.go

示例2: xEncodeTransform


//.........这里部分代码省略.........
		//assert( !uiSubdiv );
	} else {
		//assert( uiLog2TrafoSize > pcCU.GetQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
		this.m_pcEntropyCoderIf.codeTransformSubdivFlag(uiSubdiv, 5-uiLog2TrafoSize)
	}

	uiTrDepthCurr := uiDepth - uint(pcCU.GetDepth1(uiAbsPartIdx))
	bFirstCbfOfCU := uiTrDepthCurr == 0
	if bFirstCbfOfCU || uiLog2TrafoSize > 2 {
		if bFirstCbfOfCU || pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, uiTrDepthCurr-1) != 0 {
			this.m_pcEntropyCoderIf.codeQtCbf(pcCU, uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, uiTrDepthCurr)
		}
		if bFirstCbfOfCU || pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, uiTrDepthCurr-1) != 0 {
			this.m_pcEntropyCoderIf.codeQtCbf(pcCU, uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, uiTrDepthCurr)
		}
	} else if uiLog2TrafoSize == 2 {
		//assert( pcCU.GetCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU.GetCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
		//assert( pcCU.GetCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU.GetCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
	}

	if uiSubdiv != 0 {
		var size uint
		width >>= 1
		height >>= 1
		size = width * height
		uiTrIdx++
		uiDepth++
		partNum := pcCU.GetPic().GetNumPartInCU() >> (uiDepth << 1)

		this.xEncodeTransform(pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP)

		uiAbsPartIdx += partNum
		offsetLuma += size
		offsetChroma += (size >> 2)
		this.xEncodeTransform(pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP)

		uiAbsPartIdx += partNum
		offsetLuma += size
		offsetChroma += (size >> 2)
		this.xEncodeTransform(pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP)

		uiAbsPartIdx += partNum
		offsetLuma += size
		offsetChroma += (size >> 2)
		this.xEncodeTransform(pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP)
	} else {
		/*DTRACE_CABAC_VL( g_nSymbolCounter++ );*/
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\tTrIdx: abspart=")
		this.m_pcEntropyCoderIf.DTRACE_CABAC_V(uiAbsPartIdx)
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\tdepth=")
		this.m_pcEntropyCoderIf.DTRACE_CABAC_V(uiDepth)
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\ttrdepth=")
		this.m_pcEntropyCoderIf.DTRACE_CABAC_V(uint(pcCU.GetTransformIdx1(uiAbsPartIdx)))
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\n")

		if pcCU.GetPredictionMode1(uiAbsPartIdx) != TLibCommon.MODE_INTRA && uiDepth == uint(pcCU.GetDepth1(uiAbsPartIdx)) && pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_U, 0) == 0 && pcCU.GetCbf3(uiAbsPartIdx, TLibCommon.TEXT_CHROMA_V, 0) == 0 {
			//assert( pcCU.GetCbf( uiAbsPartIdx, TLibCommon.TEXT_LUMA, 0 ) );
		} else {
			this.m_pcEntropyCoderIf.codeQtCbf(pcCU, uiAbsPartIdx, TLibCommon.TEXT_LUMA, uint(pcCU.GetTransformIdx1(uiAbsPartIdx)))
		}

		if cbfY != 0 || cbfU != 0 || cbfV != 0 {
			// dQP: only for LCU once
			if pcCU.GetSlice().GetPPS().GetUseDQP() {
				if *bCodeDQP {
					this.encodeQP(pcCU, this.m_bakAbsPartIdxCU, false)
					*bCodeDQP = false
				}
			}
		}
		if cbfY != 0 {
			trWidth := width
			trHeight := height
			this.m_pcEntropyCoderIf.codeCoeffNxN(pcCU, pcCU.GetCoeffY()[offsetLuma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_LUMA)
		}
		if uiLog2TrafoSize > 2 {
			trWidth := width >> 1
			trHeight := height >> 1
			if cbfU != 0 {
				this.m_pcEntropyCoderIf.codeCoeffNxN(pcCU, pcCU.GetCoeffCb()[offsetChroma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_U)
			}
			if cbfV != 0 {
				this.m_pcEntropyCoderIf.codeCoeffNxN(pcCU, pcCU.GetCoeffCr()[offsetChroma:], uiAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_V)
			}
		} else {
			partNum := pcCU.GetPic().GetNumPartInCU() >> ((uiDepth - 1) << 1)
			if (uiAbsPartIdx % partNum) == (partNum - 1) {
				trWidth := width
				trHeight := height
				if cbfU != 0 {
					this.m_pcEntropyCoderIf.codeCoeffNxN(pcCU, pcCU.GetCoeffCb()[this.m_uiBakChromaOffset:], this.m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_U)
				}
				if cbfV != 0 {
					this.m_pcEntropyCoderIf.codeCoeffNxN(pcCU, pcCU.GetCoeffCr()[this.m_uiBakChromaOffset:], this.m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TLibCommon.TEXT_CHROMA_V)
				}
			}
		}
	}
	//fmt.Print("Exit xEncodeTransform\n");
}
开发者ID:hanjinze,项目名称:GoHM,代码行数:101,代码来源:TEncEntropy.go


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