39 #ifndef __TCOMDATACU__
40 #define __TCOMDATACU__
106 #if ADAPTIVE_QP_SELECTION
180 ,
TCoeff *pParentARLBuffer = 0
302 #if ADAPTIVE_QP_SELECTION
334 template <
typename T>
347 const UInt uiAbsPartIdx,
348 const UInt uiDepth );
411 UInt uiCurrPartUnitIdx,
412 Bool bEnforceSliceRestriction=
true,
413 Bool bEnforceTileRestriction=
true )
const;
416 UInt uiCurrPartUnitIdx,
417 Bool bEnforceSliceRestriction=
true,
418 Bool planarAtCTUBoundary =
false,
419 Bool bEnforceTileRestriction=
true )
const;
488 namespace RasterAddress
499 return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0;
511 return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0;
533 return ( addr & ( numUnitsPerRow - 1 ) ) == 0;
544 return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0;
556 return ( addr & ( numUnitsPerRow - 1 ) ) < val;
568 return addr < val * numUnitsPerRow;
Void copyPartFrom(TComDataCU *pcCU, UInt uiPartUnitIdx, UInt uiDepth)
UInt getQuadtreeTULog2MinSizeInCU(UInt uiIdx) const
UChar getNumPartitions(const UInt uiAbsPartIdx=0) const
Void setMVPNumSubParts(Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
UChar getMergeIndex(UInt uiIdx) const
Void initEstData(const UInt uiDepth, const Int qp, const Bool bTransquantBypass)
SChar * getMVPIdx(RefPicList eRefPicList)
UChar getWidth(UInt uiIdx) const
Void setIPCMFlag(UInt uiIdx, Bool b)
Int getMVPIdx(RefPicList eRefPicList, UInt uiIdx) const
SChar * m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]
array of cross-component prediction alpha values
UInt m_absZIdxInCtu
absolute address in a CTU. It's Z scan order
Void setSkipFlagSubParts(Bool skip, UInt absPartIdx, UInt depth)
UInt m_uiTotalBins
sum of partition bins
SChar * getPartitionSize()
Bool getIPCMFlag(UInt uiIdx) const
TCoeff * getArlCoeff(ComponentID component)
Bool getSkipFlag(UInt idx) const
UChar * m_puhDepth
array of depths
Bool CUIsFromSameTile(const TComDataCU *pCU) const
picture class (symbol + YUV buffers)
UChar getCbf(UInt uiIdx, ComponentID eType, UInt uiTrDepth) const
Void initSubCU(TComDataCU *pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp)
Defines version information, constants and small in-line functions.
UInt Distortion
distortion measurement
Void getMvPredLeft(TComMv &rcMvPred) const
UChar getDepth(UInt uiIdx) const
Void getInterMergeCandidates(UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField *pcMFieldNeighbours, UChar *puhInterDirNeighbours, Int &numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx=-1) const
Construct a list of merging candidates.
UChar * getExplicitRdpcmMode(ComponentID component)
Void deriveRightBottomIdx(UInt uiPartIdx, UInt &ruiPartIdxRB) const
Void deriveLeftBottomIdx(UInt uiPartIdx, UInt &ruiPartIdxLB) const
const TComSPSRExt & getSpsRangeExtension() const
SChar * getCrossComponentPredictionAlpha(ComponentID compID)
Void deriveLeftRightTopIdxGeneral(UInt uiAbsPartIdx, UInt uiPartIdx, UInt &ruiPartIdxLT, UInt &ruiPartIdxRT) const
const TComDataCU * getPUBelowLeft(UInt &uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset=1, Bool bEnforceSliceRestriction=true) const
returns CU and part index of the PU left of the lefthand column of the current uiCurrPartUnitIdx of t...
Int getMVPNum(RefPicList eRefPicList, UInt uiIdx) const
Void fillMvpCand(const UInt uiPartIdx, const UInt uiPartAddr, const RefPicList eRefPicList, const Int iRefIdx, AMVPInfo *pInfo) const
Void setMergeFlagSubParts(Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
UChar * getTransformIdx()
Void setPredictionMode(UInt uiIdx, PredMode uh)
UChar getQtRootCbf(UInt uiIdx) const
TComMv const & getMv() const
Void initCtu(TComPic *pcPic, UInt ctuRsAddr)
Void setMergeFlag(UInt uiIdx, Bool b)
class for motion vector with reference index
static Bool isEqualCol(Int addrA, Int addrB, Int numUnitsPerRow)
slice header and SPS class (header)
UInt m_uiTotalBits
sum of partition bits
PartSize getPartitionSize(UInt uiIdx) const
Bool isLastColumnCTUInTile() const
RD cost computation classes (header)
PredMode getPredictionMode(UInt uiIdx) const
SChar * getPredictionMode()
Void setExplicitRdpcmModePartRange(UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
TComPic * m_pcPic
picture class pointer
TComDataCU * getCtuAboveLeft()
Void setQPSubCUs(Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf)
Void setTransformSkipPartRange(UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Bool getTMctsMvpIsValid()
Bool CUIsFromSameSliceTileAndWavefrontRow(const TComDataCU *pCU) const
TComDataCU * getCtuAboveRight()
static Bool isEqualRowOrCol(Int addrA, Int addrB, Int numUnitsPerRow)
Bool getCUTransquantBypass(UInt uiIdx) const
Void setCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Bool xAddMVPCandUnscaled(AMVPInfo &info, const RefPicList eRefPicList, const Int iRefIdx, const UInt uiPartUnitIdx, const MVP_DIR eDir) const
adds a single possible motion vector predictor candidate
UChar * m_puhCbf[MAX_NUM_COMPONENT]
array of coded block flags (CBF)
UInt getCtxSkipFlag(UInt uiAbsPartIdx) const
UChar * m_puhMergeIndex
array of merge candidate indices
Void copyInterPredInfoFrom(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList)
UChar getCbf(UInt uiIdx, ComponentID eType) const
TComMvField m_cMvFieldA
motion vector of position A
UInt getCtxInterDir(UInt uiAbsPartIdx) const
Void setWidth(UInt uiIdx, UChar uh)
const TComDataCU * getPUAboveRight(UInt &uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset=1, Bool bEnforceSliceRestriction=true) const
returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU...
Void setPartitionSize(UInt uiIdx, PartSize uh)
UChar * m_puhTrIdx
array of transform indices
Void clearCbf(UInt uiIdx, ComponentID eType, UInt uiNumParts)
UInt getZorderIdxInCtu() const
Distortion & getTotalDistortion()
Bool m_bDecSubCu
indicates decoder-mode
static Bool lessThanCol(Int addr, Int val, Int numUnitsPerRow)
Void getAllowedChromaDir(UInt uiAbsPartIdx, UInt *uiModeList) const
Void setCUTransquantBypassSubParts(Bool flag, UInt uiAbsPartIdx, UInt uiDepth)
Bool CUIsFromSameSlice(const TComDataCU *pCU) const
TComDataCU * m_pCtuAboveRight
pointer of above-right CTU.
Bool isInter(UInt uiPartIdx) const
const TComDataCU * getQpMinCuAbove(UInt &uiAPartUnitIdx, UInt uiCurrAbsIdxInCtu) const
Void setInterDirSubParts(UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
SChar * m_pePartSize
array of partition sizes
Void setOutsideCUPart(UInt uiAbsPartIdx, UInt uiDepth)
class for motion information in one CU
static Bool isEqualRow(Int addrA, Int addrB, Int numUnitsPerRow)
SChar * m_apiMVPIdx[NUM_REF_PIC_LIST_01]
array of motion vector predictor candidates
const TComDataCU * getQpMinCuLeft(UInt &uiLPartUnitIdx, UInt uiCurrAbsIdxInCtu) const
Void setChromaQpAdjSubParts(UChar val, Int absPartIdx, Int depth)
PartSize
supported partition shape
TComMvField m_cMvFieldB
motion vector of position B
Void setDepthSubParts(UInt uiDepth, UInt uiAbsPartIdx)
UInt m_uiCUPelY
CU position in a pixel (Y)
Bool hasEqualMotion(UInt uiAbsPartIdx, const TComDataCU *pcCandCU, UInt uiCandAbsPartIdx) const
UInt getIntraSizeIdx(UInt uiAbsPartIdx) const
UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const
UChar * getIntraDir(const ChannelType channelType) const
Void setSkipFlag(UInt idx, Bool skip)
UChar * m_puhInterDir
array of inter directions
Void setCrossComponentPredictionAlphaPartRange(SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
static Bool lessThanRow(Int addr, Int val, Int numUnitsPerRow)
Bool isIntra(UInt uiPartIdx) const
Void setPartSizeSubParts(PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth)
Void setTMctsMvpIsValid(Bool b)
Void setTransformSkipSubParts(UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth)
TComDataCU * m_pCtuAbove
pointer of above CTU.
const TComDataCU * getPULeft(UInt &uiLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceTileRestriction=true) const
#define ADAPTIVE_QP_SELECTION
G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection.
Double m_dTotalCost
sum of partition RD costs
Void clipMv(TComMv &rcMv) const
TCoeff * m_pcTrCoeff[MAX_NUM_COMPONENT]
array of transform coefficient buffers (0->Y, 1->Cb, 2->Cr)
Pel * m_pcIPCMSample[MAX_NUM_COMPONENT]
PCM sample buffer (0->Y, 1->Cb, 2->Cr)
Bool isLosslessCoded(UInt absPartIdx) const
static Bool isZeroRow(Int addr, Int numUnitsPerRow)
Void setIntraDirSubParts(const ChannelType channelType, const UInt uiDir, const UInt uiAbsPartIdx, const UInt uiDepth)
Bool isRDPCMEnabled(UInt uiAbsPartIdx) const
UInt getCtxSplitFlag(UInt uiAbsPartIdx, UInt uiDepth) const
Void getPartPosition(UInt partIdx, Int &xP, Int &yP, Int &nPSW, Int &nPSH) const
Bool isFirstAbsZorderIdxInDepth(UInt uiAbsPartIdx, UInt uiDepth) const
motion information handling classes (header)
MVP_DIR
motion vector predictor direction used in AMVP
TComDataCU * getCtuLeft()
Void getIntraDirPredictor(UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int *piMode=0) const
UChar * m_puhTransformSkip[MAX_NUM_COMPONENT]
array of transform skipping flags
Int TCoeff
transform coefficient
UChar getInterDir(UInt uiIdx) const
Void setMergeIndex(UInt uiIdx, UInt uiMergeIndex)
UChar * m_ChromaQpAdj
array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0...
RefPicList
reference list index
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Void getMvPredAboveRight(TComMv &rcMvPred) const
SChar getCrossComponentPredictionAlpha(UInt uiIdx, ComponentID compID)
Void setSubPart(T bParameter, T *pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx)
Distortion m_uiTotalDistortion
sum of partition distortion
UInt m_uiCUPelX
CU position in a pixel (X)
Void setCodedChromaQpAdj(SChar qp)
TComCUMvField m_acCUMvField[NUM_REF_PIC_LIST_01]
array of motion vectors.
Bool isSkipped(UInt uiPartIdx) const
returns true, if the partiton is skipped
Void setQPSubParts(Int qp, UInt uiAbsPartIdx, UInt uiDepth)
Void copyToPic(UChar uiDepth)
Void copySubCU(TComDataCU *pcCU, UInt uiPartUnitIdx)
static Void getMvField(const TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField &rcMvField)
UChar * getTransformSkip(ComponentID compID)
Void setIPCMFlagSubParts(Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth)
Void getPartIndexAndSize(UInt uiPartIdx, UInt &ruiPartAddr, Int &riWidth, Int &riHeight) const
static Int xGetDistScaleFactor(Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC)
compute scaling factor from POC difference
SChar getCodedChromaQpAdj() const
TComDataCU * m_pCtuLeft
pointer of left CTU
Void setSizeSubParts(UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth)
Void xDeriveCenterIdx(UInt uiPartIdx, UInt &ruiPartIdxCenter) const
static Bool isZeroCol(Int addr, Int numUnitsPerRow)
Bool * getCUTransquantBypass()
UInt getSliceCurStartCtuTsAddr() const
Bool xGetColMVP(const RefPicList eRefPicList, const Int ctuRsAddr, const Int partUnitIdx, TComMv &rcMv, const Int refIdx) const
Bool xAddMVPCandWithScaling(AMVPInfo &info, const RefPicList eRefPicList, const Int iRefIdx, const UInt uiPartUnitIdx, const MVP_DIR eDir) const
UChar * m_puhWidth
array of widths
Void setDepth(UInt uiIdx, UChar uh)
Bool isDiffMER(Int xN, Int yN, Int xP, Int yP) const
const TComDataCU * getPUAboveLeft(UInt &uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true) const
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
Void setHeight(UInt uiIdx, UChar uh)
UInt m_uiNumPartition
total number of minimum partitions in a CU
neighbouring pixel access classes (header)
UChar getTransformSkip(UInt uiIdx, ComponentID compID) const
const TComDataCU * getPUAbove(UInt &uiAPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool planarAtCTUBoundary=false, Bool bEnforceTileRestriction=true) const
UChar getTransformIdx(UInt uiIdx) const
UInt m_ctuRsAddr
CTU (also known as LCU) address in a slice (Raster-scan address, as opposed to tile-scan/encoding ord...
Int getLastValidPartIdx(Int iAbsPartIdx) const
UChar getIntraDir(const ChannelType channelType, const UInt uiIdx) const
UChar getChromaQpAdj(Int idx) const
When value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu...
TComMvField m_cMvFieldC
motion vector of position C
Bool getRdpcmEnabledFlag(const RDPCMSignallingMode signallingMode) const
TComDataCU * getCtuAbove()
Void setQP(UInt uiIdx, SChar value)
Bool m_ArlCoeffIsAliasedAllocation
ARL coefficient buffer is an alias of the global buffer and must not be free()'d. ...
Void setCbfSubParts(const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth)
SChar * m_pePredMode
array of prediction modes
UInt getCtxQtCbf(TComTU &rTu, const ChannelType chType) const
Void setInterDir(UInt uiIdx, UChar uh)
Void setCbf(UInt uiIdx, ComponentID eType, UChar uh)
TComCUMvField * getCUMvField(RefPicList e)
TCoeff * getCoeff(ComponentID component)
Bool isLastSubCUOfCtu(const UInt absPartIdx) const
Bool * m_CUTransquantBypass
array of cu_transquant_bypass flags
basic motion vector class
Bool CUIsFromSameSliceAndTile(const TComDataCU *pCU) const
SChar getLastCodedQP(UInt uiAbsPartIdx) const
SChar * getMVPNum(RefPicList eRefPicList)
PredMode
supported prediction type
Void setMVPIdx(RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)
UInt getCtuRsAddr() const
Void setMVPNum(RefPicList eRefPicList, UInt uiIdx, Int iMVPNum)
Void deriveLeftRightTopIdx(UInt uiPartIdx, UInt &ruiPartIdxLT, UInt &ruiPartIdxRT) const
Void setPredModeSubParts(PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth)
TCoeff * m_pcArlCoeff[MAX_NUM_COMPONENT]
ARL coefficient buffer (0->Y, 1->Cb, 2->Cr)
Void setMergeIndexSubParts(UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
TComSlice * m_pcSlice
slice header pointer
Bool isBipredRestriction(UInt puIdx) const
Void setChromaQpAdj(Int idx, UChar val)
When val = 0, cu_chroma_qp_offset_flag=0; when val>0, indicates cu_chroma_qp_offset_flag=1 and cu_chr...
SChar getRefQP(UInt uiCurrAbsIdxInCtu) const
Void getMvPredAbove(TComMv &rcMvPred) const
TComDataCU * m_pCtuAboveLeft
pointer of above-left CTU.
UChar * m_puhHeight
array of heights
Bool * m_skipFlag
array of skip flags
UChar getHeight(UInt uiIdx) const
Pel * getPCMSample(ComponentID component)
UChar * getCbf(ComponentID eType)
Bool * m_pbIPCMFlag
array of intra_pcm flags
SChar * m_phQP
array of QP values
Void setMVPIdxSubParts(Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
TComMv m_cMvPred
motion vector predictor
UChar getExplicitRdpcmMode(ComponentID component, UInt partIdx) const
Bool getMergeFlag(UInt uiIdx) const
static const UInt NUM_MOST_PROBABLE_MODES
const TComCUMvField * getCUMvField(RefPicList e) const
UChar * getChromaQpAdj()
array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0...
const TComSlice * getSlice() const
Int m_unitSize
size of a "minimum partition"
SChar getQP(UInt uiIdx) const
Void setCodedQP(SChar qp)
Void bitwiseOrCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
UChar * m_explicitRdpcmMode[MAX_NUM_COMPONENT]
Stores the explicit RDPCM mode for all TUs belonging to this CU.
Void deriveLeftBottomIdxGeneral(UInt uiAbsPartIdx, UInt uiPartIdx, UInt &ruiPartIdxLB) const
Bool * m_pbMergeFlag
array of merge flags
const TComPic * getPic() const
const TComSPS * getSPS() const
SChar * m_apiMVPNum[NUM_REF_PIC_LIST_01]
array of number of possible motion vectors predictors
Void setTrIdxSubParts(UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth)
UChar * m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]