Exemplo n.º 1
0
func (this *TDecEntropy) DecodePredInfo(pcCU *TLibCommon.TComDataCU, uiAbsPartIdx, uiDepth uint, pcSubCU *TLibCommon.TComDataCU) {
	if pcCU.IsIntra(uiAbsPartIdx) {
		this.DecodeIntraDirModeLuma(pcCU, uiAbsPartIdx, uiDepth)
		this.DecodeIntraDirModeChroma(pcCU, uiAbsPartIdx, uiDepth)
	} else {
		this.DecodePUWise(pcCU, uiAbsPartIdx, uiDepth, pcSubCU)
	}
}
Exemplo n.º 2
0
func (this *TEncEntropy) encodePredInfo(pcCU *TLibCommon.TComDataCU, uiAbsPartIdx uint, bRD bool) { // = false );
	if bRD {
		uiAbsPartIdx = 0
	}
	//fmt.Printf("uiAbsPartIdx=%d\n", uiAbsPartIdx);
	if pcCU.IsIntra(uiAbsPartIdx) { // If it is Intra mode, encode intra prediction mode.
		this.encodeIntraDirModeLuma(pcCU, uiAbsPartIdx, true)
		this.encodeIntraDirModeChroma(pcCU, uiAbsPartIdx, bRD)
	} else {
		this.encodePUWise(pcCU, uiAbsPartIdx, bRD)
	}
}
Exemplo n.º 3
0
func (this *TDecEntropy) DecodeCoeff(pcCU *TLibCommon.TComDataCU, uiAbsPartIdx, uiDepth, uiWidth, uiHeight uint, bCodeDQP *bool) {
	uiMinCoeffSize := pcCU.GetPic().GetMinCUWidth() * pcCU.GetPic().GetMinCUHeight()
	uiLumaOffset := uiMinCoeffSize * uiAbsPartIdx
	uiChromaOffset := uiLumaOffset >> 2

	if !pcCU.IsIntra(uiAbsPartIdx) {
		uiQtRootCbf := uint(1)
		if !(pcCU.GetPartitionSize1(uiAbsPartIdx) == TLibCommon.SIZE_2Nx2N && pcCU.GetMergeFlag1(uiAbsPartIdx)) {
			this.m_pcEntropyDecoderIf.ParseQtRootCbf(uiAbsPartIdx, &uiQtRootCbf)
		}
		if uiQtRootCbf == 0 {
			pcCU.SetCbfSubParts(0, 0, 0, uiAbsPartIdx, uiDepth)
			pcCU.SetTrIdxSubParts(0, uiAbsPartIdx, uiDepth)
			return
		}

	}
	this.xDecodeTransform(pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP)
}
Exemplo n.º 4
0
func (this *TEncEntropy) encodeCoeff(pcCU *TLibCommon.TComDataCU, uiAbsPartIdx, uiDepth, uiWidth, uiHeight uint, bCodeDQP *bool) {
	uiMinCoeffSize := pcCU.GetPic().GetMinCUWidth() * pcCU.GetPic().GetMinCUHeight()
	uiLumaOffset := uiMinCoeffSize * uiAbsPartIdx
	uiChromaOffset := uiLumaOffset >> 2

	if pcCU.IsIntra(uiAbsPartIdx) {
		/*DTRACE_CABAC_VL( g_nSymbolCounter++ )*/
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\tdecodeTransformIdx()\tCUDepth=")
		this.m_pcEntropyCoderIf.DTRACE_CABAC_V(uiDepth)
		this.m_pcEntropyCoderIf.DTRACE_CABAC_T("\n")
	} else {
		if !(pcCU.GetMergeFlag1(uiAbsPartIdx) && pcCU.GetPartitionSize1(uiAbsPartIdx) == TLibCommon.SIZE_2Nx2N) {
			this.m_pcEntropyCoderIf.codeQtRootCbf(pcCU, uiAbsPartIdx)
		}
		if !pcCU.GetQtRootCbf(uiAbsPartIdx) {
			return
		}
	}

	this.xEncodeTransform(pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP)
}