43 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
44 #include "../TLibCommon/Debug.h"
209 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
213 printf(
"x..codeTransform: offsetLuma=%d offsetChroma=%d absPartIdx=%d, uiDepth=%d\n width=%d, height=%d, uiTrIdx=%d, uiInnerQuadIdx=%d\n",
222 Bool bHaveACodedBlock =
false;
223 Bool bHaveACodedChromaBlock =
false;
225 for(
UInt ch=0; ch<numValidComponent; ch++)
229 cbf[compID] = pcCU->
getCbf( uiAbsPartIdx, compID , uiTrIdx );
233 bHaveACodedBlock =
true;
236 bHaveACodedChromaBlock =
true;
274 const UInt uiTrDepthCurr = uiDepth - pcCU->
getDepth( uiAbsPartIdx );
275 const Bool bFirstCbfOfCU = uiTrDepthCurr == 0;
282 if( bFirstCbfOfCU || pcCU->
getCbf( uiAbsPartIdx, compID, uiTrDepthCurr - 1 ) )
289 assert( pcCU->
getCbf( uiAbsPartIdx, compID, uiTrDepthCurr ) == pcCU->
getCbf( uiAbsPartIdx, compID, uiTrDepthCurr - 1 ) );
324 if ( bHaveACodedBlock )
341 codeChromaQpAdj =
false;
353 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
356 printf(
"Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.
getRect(compID).
width, rTu.
getRect(compID).
height, 1);
371 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
374 printf(
"Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.
getRect(compID).
width, subTUIterator.
getRect(compID).
height, 1);
389 if (cbf[compID] != 0)
413 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
421 printf(
"coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->
getIntraDir(
CHANNEL_TYPE_LUMA, uiAbsPartIdx));
429 if( pcCU->
isIntra( uiAbsPartIdx ) )
459 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
468 for (
UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
474 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
477 std::cout <<
"Coded merge flag, CU absPartIdx: " << uiAbsPartIdx <<
" PU(" << uiPartIdx <<
") absPartIdx: " << uiSubPartIdx;
478 std::cout <<
" merge index: " << (
UInt)pcCU->
getMergeIndex(uiSubPartIdx) << std::endl;
485 for (
UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
492 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
495 std::cout <<
"refListIdx: " << uiRefListIdx << std::endl;
498 std::cout <<
"MVPIdxPU: " << pcCU->
getMVPIdx(
RefPicList( uiRefListIdx ), uiSubPartIdx) << std::endl;
499 std::cout <<
"InterDir: " << (
UInt)pcCU->
getInterDir(uiSubPartIdx) << std::endl;
525 assert( pcCU->
isInter( uiAbsPartIdx ) );
532 if ( pcCU->
getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
543 assert( pcCU->
isInter( uiAbsPartIdx ) );
545 if ( pcCU->
getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
554 if ( (pcCU->
getInterDir( uiAbsPartIdx ) & ( 1 << eRefList )) )
617 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
621 if( pcCU->
isIntra(uiAbsPartIdx) )
644 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
687 const UInt heightAtEntropyCoding = (width != height) ? (height >> 1) : height;
696 for (
Int i = 0; i < uiSize; i++ )
698 count += pcCoef[i] != 0;
virtual Void codeMVPIdx(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefList)=0
UInt getQuadtreeTULog2MinSizeInCU(UInt uiIdx) const
Void encodeMergeFlag(TComDataCU *pcCU, UInt uiAbsPartIdx)
encode merge flag
sample adaptive offset class (header)
entropy encoder class (header)
Void encodeSPS(const TComSPS *pcSPS)
static Int countNonZeroCoeffs(TCoeff *pcCoef, UInt uiSize)
Int getMVPIdx(RefPicList eRefPicList, UInt uiIdx) const
SChar * getPartitionSize()
Void encodeMvdPU(TComDataCU *pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList)
encode motion vector difference for a PU block
Defines version information, constants and small in-line functions.
virtual Void codeDeltaQP(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
virtual Void codeCrossComponentPrediction(TComTU &rTu, ComponentID compID)=0
virtual Void codeQtRootCbfZero()=0
Void encodeTransformSubdivFlag(UInt uiSymbol, UInt uiCtx)
UChar * getTransformIdx()
Void encodeChromaQpAdjustment(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
encode chroma qp adjustment
UChar getQtRootCbf(UInt uiIdx) const
Void encodePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
encode prediction mode
virtual Void codeSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
Bool getUseChromaQpAdj() const
Void encodeSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD=false)
encode split flag
virtual Void codeRefFrmIdx(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefList)=0
Void encodeSliceHeader(TComSlice *pcSlice)
UInt getNumPartitionsInCtu() const
virtual Void codeSPS(const TComSPS *pcSPS)=0
virtual Void codeCoeffNxN(TComTU &rTu, TCoeff *pcCoef, const ComponentID compID)=0
UInt getPCMLog2MaxSize() const
virtual Void codeCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
UInt GetTransformDepthRel() const
Int getNumberValidComponents() const
TComMv const & getMvd(Int iIdx) const
UChar getCbf(UInt uiIdx, ComponentID eType) const
virtual Void codeVPS(const TComVPS *pcVPS)=0
virtual Void codeIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
Bool nextSection(const TComTU &parent)
virtual Void codePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
Int getNumRefIdx(RefPicList e) const
Void encodeQP(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
UInt GetSectionNumber() const
Bool isInter(UInt uiPartIdx) const
Void encodeRefFrmIdxPU(TComDataCU *pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList)
encode reference frame index for a PU block
UInt GetAbsPartIdxTU() const
Void encodeCoeffNxN(TComTU &rTu, TCoeff *pcCoef, const ComponentID compID)
UInt getMaxTotalCUDepth() const
virtual Void codeTilesWPPEntryPoint(TComSlice *pSlice)=0
PartSize
supported partition shape
virtual Void codeQtCbfZero(TComTU &rTu, const ChannelType chType)=0
const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES]
Void xEncodeTransform(Bool &bCodeDQP, Bool &codeChromaQpAdj, TComTU &rTu)
Void encodePUWise(TComDataCU *pcCU, UInt uiAbsPartIdx)
encode motion information for every PU block
UChar * getIntraDir(const ChannelType channelType) const
virtual Void codeSliceFinish()=0
symmetric motion partition, 2Nx2N
Void encodeCoeff(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &bCodeDQP, Bool &codeChromaQpAdj)
encode coefficients
Bool isIntra(UInt uiPartIdx) const
Void estimateBit(estBitsSbacStruct *pcEstBitsSbac, Int width, Int height, ChannelType chType, COEFF_SCAN_TYPE scanType)
Void encodeIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
virtual Void codeMvd(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefList)=0
Void encodeQtCbfZero(TComTU &rTu, const ChannelType chType)
virtual Void codeMergeIndex(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
UInt getPCMLog2MinSize() const
virtual Void codeSliceHeader(TComSlice *pcSlice)=0
Bool ProcessingAllQuadrants(const ComponentID compID) const
Int TCoeff
transform coefficient
virtual Void estBit(estBitsSbacStruct *pcEstBitsSbac, Int width, Int height, ChannelType chType, COEFF_SCAN_TYPE scanType)=0
RefPicList
reference list index
UInt GetLog2LumaTrSize() const
UInt getCoefficientOffset(const ComponentID compID) const
#define DTRACE_CABAC_VL(x)
UInt getQuadtreeTULog2MinSize() const
const TComRectangle & getRect(const ComponentID compID) const
COEFF_SCAN_TYPE
coefficient scanning type used in ACS
virtual Void codeChromaQpAdjustment(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
const TComPPS * getPPS() const
Void encodePPS(const TComPPS *pcPPS)
entropy encoder pure class
ChromaFormat getChromaFormat() const
virtual Void codeQtCbf(TComTU &rTu, const ComponentID compID, const Bool lowestLevel)=0
#define DTRACE_CABAC_T(x)
Void encodeQtRootCbf(TComDataCU *pcCU, UInt uiAbsPartIdx)
Void encodeIntraDirModeChroma(TComDataCU *pcCU, UInt uiAbsPartIdx)
encode intra direction for chroma
virtual Void codeQtRootCbf(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
virtual Void codeTransformSubdivFlag(UInt uiSymbol, UInt uiCtx)=0
Bool ProcessComponentSection(const ComponentID compID) const
virtual Void codeSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
Void encodeTilesWPPEntryPoint(TComSlice *pSlice)
Bool * getCUTransquantBypass()
Bool getFinalized() const
Void setEntropyCoder(TEncEntropyIf *e)
Void encodeInterDirPU(TComDataCU *pcSubCU, UInt uiAbsPartIdx)
virtual Void codeIntraDirChroma(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
Void encodeCrossComponentPrediction(TComTU &rTu, ComponentID compID)
virtual Void codePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
Void encodeQtCbf(TComTU &rTu, const ComponentID compID, const Bool lowestLevel)
Void encodeCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
Void encodePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD=false)
encode partition size
TComCUMvField * getCUMvField(RefPicList e)
TCoeff * getCoeff(ComponentID component)
#define DTRACE_CABAC_V(x)
UInt getQuadtreeTULog2MaxSize() const
Void encodeIntraDirModeLuma(TComDataCU *pcCU, UInt absPartIdx, Bool isMultiplePU=false)
encode intra direction for luma
UInt GetAbsPartIdxCU() const
Void encodeMergeIndex(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
encode merge index
Void encodeTerminatingBit(UInt uiIsLast)
virtual Void codeMergeFlag(TComDataCU *pcCU, UInt uiAbsPartIdx)=0
symmetric motion partition, Nx N
virtual Void codeIntraDirLumaAng(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool isMultiplePU)=0
Void encodeQtRootCbfZero()
UInt getQuadtreeTUMaxDepthInter() const
Void encodePredInfo(TComDataCU *pcCU, UInt uiAbsPartIdx)
Void encodeSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, Bool bRD=false)
Void encodeMVPIdxPU(TComDataCU *pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList)
virtual Void codeTerminatingBit(UInt uilsLast)=0
virtual Void codePPS(const TComPPS *pcPPS)=0
UInt GetTransformDepthTotal() const
const TComSPS * getSPS() const
Void encodeVPS(const TComVPS *pcVPS)
TEncEntropyIf * m_pcEntropyCoderIf
virtual Void codeInterDir(TComDataCU *pcCU, UInt uiAbsPartIdx)=0