42 #if RExt__DECODER_DEBUG_BIT_STATISTICS
45 #define RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(a) , a
47 #define RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(a)
53 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
54 #include "../TLibCommon/Debug.h"
65 , m_pcTDecBinIf (
NULL )
66 , m_numContextModels ( 0 )
67 , m_cCUSplitFlagSCModel ( 1, 1,
NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
68 , m_cCUSkipFlagSCModel ( 1, 1,
NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
69 , m_cCUMergeFlagExtSCModel ( 1, 1,
NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels)
70 , m_cCUMergeIdxExtSCModel ( 1, 1,
NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels)
71 , m_cCUPartSizeSCModel ( 1, 1,
NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels)
72 , m_cCUPredModeSCModel ( 1, 1,
NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels)
73 , m_cCUIntraPredSCModel ( 1, 1,
NUM_INTRA_PREDICT_CTX , m_contextModels + m_numContextModels, m_numContextModels)
74 , m_cCUChromaPredSCModel ( 1, 1,
NUM_CHROMA_PRED_CTX , m_contextModels + m_numContextModels, m_numContextModels)
75 , m_cCUDeltaQpSCModel ( 1, 1,
NUM_DELTA_QP_CTX , m_contextModels + m_numContextModels, m_numContextModels)
76 , m_cCUInterDirSCModel ( 1, 1,
NUM_INTER_DIR_CTX , m_contextModels + m_numContextModels, m_numContextModels)
77 , m_cCURefPicSCModel ( 1, 1,
NUM_REF_NO_CTX , m_contextModels + m_numContextModels, m_numContextModels)
78 , m_cCUMvdSCModel ( 1, 1,
NUM_MV_RES_CTX , m_contextModels + m_numContextModels, m_numContextModels)
80 , m_cCUTransSubdivFlagSCModel ( 1, 1,
NUM_TRANS_SUBDIV_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
81 , m_cCUQtRootCbfSCModel ( 1, 1,
NUM_QT_ROOT_CBF_CTX , m_contextModels + m_numContextModels, m_numContextModels)
82 , m_cCUSigCoeffGroupSCModel ( 1, 2,
NUM_SIG_CG_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
83 , m_cCUSigSCModel ( 1, 1,
NUM_SIG_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
86 , m_cCUOneSCModel ( 1, 1,
NUM_ONE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
87 , m_cCUAbsSCModel ( 1, 1,
NUM_ABS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
88 , m_cMVPIdxSCModel ( 1, 1,
NUM_MVP_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels)
89 , m_cSaoMergeSCModel ( 1, 1,
NUM_SAO_MERGE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)
90 , m_cSaoTypeIdxSCModel ( 1, 1,
NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels)
178 #if RExt__DECODER_DEBUG_BIT_STATISTICS
188 if (noTrailingBytesExpected)
191 assert (numberOfRemainingSubstreamBytes == 0);
198 if (trailingNullByte!=0)
200 printf(
"Trailing byte should be 0, but has value %02x\n", trailingNullByte);
201 assert(trailingNullByte==0);
207 #if RExt__DECODER_DEBUG_BIT_STATISTICS
213 if (uiMaxSymbol == 0)
221 if( ruiSymbol == 0 || uiMaxSymbol == 1 )
233 }
while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) );
235 if( uiCont && ( uiSymbol == uiMaxSymbol - 1 ) )
240 ruiSymbol = uiSymbol;
243 #if RExt__DECODER_DEBUG_BIT_STATISTICS
255 uiSymbol += uiBit << uiCount++;
265 ruiSymbol = uiSymbol;
268 #if RExt__DECODER_DEBUG_BIT_STATISTICS
290 ruiSymbol = uiSymbol;
300 #if RExt__DECODER_DEBUG_BIT_STATISTICS
309 if (useLimitedPrefixLength)
317 }
while((codeWord != 0) && (prefix < longestPossiblePrefix));
328 codeWord = 1 - codeWord;
335 rSymbol = (prefix<<rParam) + codeWord;
337 else if (useLimitedPrefixLength)
342 const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (maxLog2TrDynamicRange - rParam) : prefixLength;
372 Bool bIpcmFlag =
true;
381 const UInt offsetY = minCoeffSizeY * uiAbsPartIdx;
390 for (
UInt y=0; y<height; y++)
392 for (
UInt x=0; x<width; x++)
396 pPCMSample[x] = sample;
477 for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx )
494 ruiMergeIndex = uiUnaryIdx;
517 #if RExt__DECODER_DEBUG_BIT_STATISTICS
538 UInt uiSymbol, uiMode = 0;
544 #if RExt__DECODER_DEBUG_BIT_STATISTICS
549 if ( pcCU->
isIntra( uiAbsPartIdx ) )
552 if( uiDepth == log2DiffMaxMinCodingBlockSize )
560 uiTrLevel = uiWidthInBit >= uiTrSizeInBit ? uiWidthInBit - uiTrSizeInBit : 0;
572 UInt uiMaxNumBits = 2;
574 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) )
579 for (
UInt ui = 0; ui < uiMaxNumBits; ui++ )
633 iPredMode += uiSymbol;
643 UInt mpmPred[4],symbol;
649 #if RExt__DECODER_DEBUG_BIT_STATISTICS
652 for (j=0;j<partNum;j++)
657 for (j=0;j<partNum;j++)
669 intraPredMode = preds[symbol];
674 intraPredMode = symbol;
677 if (preds[0] > preds[1])
679 std::swap(preds[0], preds[1]);
681 if (preds[0] > preds[2])
683 std::swap(preds[0], preds[2]);
685 if (preds[1] > preds[2])
687 std::swap(preds[1], preds[2]);
691 intraPredMode += ( intraPredMode >= preds[i] );
702 #if RExt__DECODER_DEBUG_BIT_STATISTICS
717 uiSymbol = uiAllowedChromaDir[ uiIPredMode ];
743 assert(uiSymbol == 0 || uiSymbol == 1);
747 ruiInterDir = uiSymbol;
763 for( ui = 0; ui < uiRefNum; ++ui )
780 riRefFrmIdx = uiSymbol;
804 const Bool bHorAbsGr0 = uiHorAbs != 0;
805 const Bool bVerAbsGr0 = uiVerAbs != 0;
811 uiHorAbs += uiSymbol;
817 uiVerAbs += uiSymbol;
825 uiHorAbs += uiSymbol;
836 uiVerAbs += uiSymbol;
844 const TComMv cMv( uiHorSign ? -
Int( uiHorAbs ): uiHorAbs, uiVerSign ? -
Int( uiVerAbs ) : uiVerAbs );
871 #if RExt__DECODER_DEBUG_BIT_STATISTICS
892 alpha = (sign != 0) ? -(1 << symbol) : (1 << symbol);
919 const UInt uiCtx = 0;
931 uiQtRootCbf = uiSymbol;
960 qp = (((
Int) pcCU->
getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+qpBdOffsetY)) - qpBdOffsetY;
977 #if RExt__DECODER_DEBUG_BIT_STATISTICS
986 if (symbol && chromaQpOffsetListLen > 1)
1027 const UInt lowestTUDepth = TUDepth + ((!lowestLevel && !canQuadSplit) ? 1 : 0);
1028 UInt lowestTUCBF = 0;
1030 if ((width != height) && (lowestLevel || !canQuadSplit))
1032 const UInt subTUDepth = lowestTUDepth + 1;
1035 UInt combinedSubTUCBF = 0;
1037 for (
UInt subTU = 0; subTU < 2; subTU++)
1042 const UInt subTUAbsPartIdx = absPartIdx + (subTU * partIdxesPerSubTU);
1043 pcCU->
setCbfPartRange((uiCbf << subTUDepth), compID, subTUAbsPartIdx, partIdxesPerSubTU);
1044 combinedSubTUCBF |= uiCbf;
1062 if (combinedSubTUCBF != 0)
1064 pcCU->
bitwiseOrCbfPartRange((combinedSubTUCBF << lowestTUDepth), compID, absPartIdx, coveredPartIdxes);
1065 lowestTUCBF = combinedSubTUCBF;
1087 lowestTUCBF = uiCbf;
1091 if (lowestTUCBF != 0)
1093 for (
UInt depth = TUDepth; depth < lowestTUDepth; depth++)
1116 UInt useTransformSkip;
1155 #if RExt__DECODER_DEBUG_BIT_STATISTICS
1162 swap( width, height );
1165 Int blkSizeOffsetX, blkSizeOffsetY, shiftX, shiftY;
1172 for( uiPosLastX = 0; uiPosLastX <
g_uiGroupIdx[ width - 1 ]; uiPosLastX++ )
1184 for( uiPosLastY = 0; uiPosLastY < g_uiGroupIdx[ height - 1 ]; uiPosLastY++ )
1196 if ( uiPosLastX > 3 )
1199 UInt uiCount = ( uiPosLastX - 2 ) >> 1;
1200 for (
Int i = uiCount - 1; i >= 0; i-- )
1203 uiTemp += uiLast << i;
1207 if ( uiPosLastY > 3 )
1210 UInt uiCount = ( uiPosLastY - 2 ) >> 1;
1211 for (
Int i = uiCount - 1; i >= 0; i-- )
1214 uiTemp += uiLast << i;
1221 swap( uiPosLastX, uiPosLastY );
1268 std::cerr <<
"ERROR: parseCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl;
1280 const UInt uiMaxNumCoeff = uiWidth * uiHeight;
1281 const UInt uiMaxNumCoeffM1 = uiMaxNumCoeff - 1;
1289 #if RExt__DECODER_DEBUG_BIT_STATISTICS
1329 Int uiIntraMode = -1;
1331 Int isIntra = pcCU->
isIntra(uiAbsPartIdx) ? 1 : 0;
1340 Bool rdpcm_lossy = ( transformSkip && ( (uiIntraMode ==
HOR_IDX) || (uiIntraMode ==
VER_IDX) ) );
1357 UInt uiPosLastX, uiPosLastY;
1359 UInt uiBlkPosLast = uiPosLastX + (uiPosLastY<<uiLog2BlockWidth);
1360 pcCoef[ uiBlkPosLast ] = 1;
1364 for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ )
1366 UInt uiBlkPos = codingParameters.
scan[ uiScanPosLast ];
1367 if( uiBlkPosLast == uiBlkPos )
1378 UInt uiGoRiceParam = 0;
1384 Int iScanPosSig = (
Int) uiScanPosLast;
1385 for(
Int iSubSet = iLastScanSet; iSubSet >= 0; iSubSet-- )
1389 Bool updateGolombRiceStatistics = bUseGolombRiceParameterAdaptation;
1392 Int lastNZPosInCG = -1;
1395 Bool escapeDataPresentInGroup =
false;
1399 if( iScanPosSig == (
Int) uiScanPosLast )
1401 lastNZPosInCG = iScanPosSig;
1402 firstNZPosInCG = iScanPosSig;
1404 pos[ numNonZero ] = uiBlkPosLast;
1409 Int iCGBlkPos = codingParameters.
scanCG[ iSubSet ];
1413 if( iSubSet == iLastScanSet || iSubSet == 0)
1415 uiSigCoeffGroupFlag[ iCGBlkPos ] = 1;
1419 UInt uiSigCoeffGroup;
1422 uiSigCoeffGroupFlag[ iCGBlkPos ] = uiSigCoeffGroup;
1428 UInt uiBlkPos, uiSig, uiCtxSig;
1429 for( ; iScanPosSig >= iSubPos; iScanPosSig-- )
1431 uiBlkPos = codingParameters.
scan[ iScanPosSig ];
1434 if( uiSigCoeffGroupFlag[ iCGBlkPos ] )
1436 if( iScanPosSig > iSubPos || iSubSet == 0 || numNonZero )
1438 uiCtxSig =
TComTrQuant::getSigCtxInc( patternSigCtx, codingParameters, iScanPosSig, uiLog2BlockWidth, uiLog2BlockHeight, chType );
1446 pcCoef[ uiBlkPos ] = uiSig;
1449 pos[ numNonZero ] = uiBlkPos;
1451 if( lastNZPosInCG == -1 )
1453 lastNZPosInCG = iScanPosSig;
1455 firstNZPosInCG = iScanPosSig;
1459 if( numNonZero > 0 )
1473 for (
Int i = 0; i < numNonZero; i++)
1478 Int firstC2FlagIdx = -1;
1480 for(
Int idx = 0; idx < numC1Flag; idx++ )
1486 if (firstC2FlagIdx == -1)
1488 firstC2FlagIdx = idx;
1492 escapeDataPresentInGroup =
true;
1495 else if( (c1 < 3) && (c1 > 0) )
1499 absCoeff[ idx ] = uiBin + 1;
1505 if ( firstC2FlagIdx != -1)
1508 absCoeff[ firstC2FlagIdx ] = uiBin + 2;
1511 escapeDataPresentInGroup =
true;
1516 escapeDataPresentInGroup = escapeDataPresentInGroup || (numNonZero >
C1FLAG_NUMBER);
1518 const Bool alignGroup = escapeDataPresentInGroup && alignCABACBeforeBypass;
1520 #if RExt__DECODER_DEBUG_BIT_STATISTICS
1531 if ( signHidden && beValid )
1534 coeffSigns <<= 32 - (numNonZero-1);
1539 coeffSigns <<= 32 - numNonZero;
1542 Int iFirstCoeff2 = 1;
1543 if (escapeDataPresentInGroup)
1545 for(
Int idx = 0; idx < numNonZero; idx++ )
1549 if( absCoeff[ idx ] == baseLevel)
1554 absCoeff[ idx ] = uiLevel + baseLevel;
1556 if (absCoeff[idx] > (3 << uiGoRiceParam))
1558 uiGoRiceParam = bUseGolombRiceParameterAdaptation ? (uiGoRiceParam + 1) : (std::min<UInt>((uiGoRiceParam + 1), 4));
1561 if (updateGolombRiceStatistics)
1565 if (uiLevel >= (3 << initialGolombRiceParameter))
1567 currentGolombRiceStatistic++;
1569 else if (((uiLevel * 2) < (1 << initialGolombRiceParameter)) && (currentGolombRiceStatistic > 0))
1571 currentGolombRiceStatistic--;
1574 updateGolombRiceStatistics =
false;
1578 if(absCoeff[ idx ] >= 2)
1585 for(
Int idx = 0; idx < numNonZero; idx++ )
1587 Int blkPos = pos[ idx ];
1589 pcCoef[ blkPos ] = absCoeff[ idx ];
1590 absSum += absCoeff[ idx ];
1592 if ( idx == numNonZero-1 && signHidden && beValid )
1597 pcCoef[ blkPos ] = -pcCoef[ blkPos ];
1602 Int sign =
static_cast<Int>( coeffSigns ) >> 31;
1603 pcCoef[ blkPos ] = ( pcCoef[ blkPos ] ^ sign ) - sign;
1610 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
1661 ruiVal = (
Int)uiCode;
1692 ,
Bool* sliceEnabled
1693 ,
Bool leftMergeAvail
1694 ,
Bool aboveMergeAvail
1700 Bool isLeftMerge =
false;
1701 Bool isAboveMerge=
false;
1706 isLeftMerge = (uiSymbol?
true:
false);
1709 if( aboveMergeAvail && !isLeftMerge)
1712 isAboveMerge = (uiSymbol?
true:
false);
1715 if(isLeftMerge || isAboveMerge)
1729 SAOOffset& ctbParam = saoBlkParam[compIdx];
1730 #if O0043_BEST_EFFORT_DECODING
1737 if(!sliceEnabled[compIdx])
1745 if(compIdx == firstCompOfChType)
1749 assert(uiSymbol ==0 || uiSymbol ==1 || uiSymbol ==2);
1755 else if(uiSymbol == 1)
1776 for(
Int i=0; i< 4; i++)
1779 offset[i] = (
Int)uiSymbol;
1784 for(
Int i=0; i< 4; i++)
1791 #if O0043_BEST_EFFORT_DECODING
1792 offset[i] >>= forceBitDepthAdjust;
1794 offset[i] = -offset[i];
1801 for(
Int i=0; i<4; i++)
1811 if(firstCompOfChType == compIdx)
1818 ctbParam.
typeIdc = saoBlkParam[firstCompOfChType].typeIdc;
1871 assert(tuHeight == tuWidth);
1873 #if RExt__DECODER_DEBUG_BIT_STATISTICS
#define NUM_SAO_EO_TYPES_LOG2
SChar g_aucConvertToBit[MAX_CU_SIZE+1]
#define NUM_SAO_BO_CLASSES_LOG2
Bool getCrossComponentPredictionEnabledFlag() const
Void loadContexts(const TDecSbac *pSrc)
static const UChar INIT_SAO_MERGE_FLAG[NUMBER_OF_SLICE_TYPES][1]
#define NUM_QT_ROOT_CBF_CTX
number of context models for QT ROOT CBF
SliceType
supported slice type
Bool getPersistentRiceAdaptationEnabledFlag() const
#define MAX_NUM_SAO_CLASSES
SBAC decoder class (header)
Void parseIntraDirChroma(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
ContextModel3DBuffer m_cCUMergeFlagExtSCModel
Void setSkipFlagSubParts(Bool skip, UInt absPartIdx, UInt depth)
Void parseMVPIdx(Int &riMVPIdx)
virtual Void xReadPCMCode(UInt uiLength, UInt &ruiCode)=0
SChar * getPartitionSize()
static Int getSigCtxInc(Int patternSigCtx, const TUEntropyCodingParameters &codingParameters, const Int scanPosition, const Int log2BlockWidth, const Int log2BlockHeight, const ChannelType chanType)
Void parseTerminatingBit(UInt &ruiBit)
SliceType getSliceType() const
ContextModel3DBuffer m_cSaoMergeSCModel
static const UChar INIT_PART_SIZE[NUMBER_OF_SLICE_TYPES][4]
Void parseQtRootCbf(UInt uiAbsPartIdx, UInt &uiQtRootCbf)
static const Int HOR_IDX
index for intra HORIZONTAL mode
static const UChar INIT_LAST[NUMBER_OF_SLICE_TYPES][2 *15]
Void parseSaoSign(UInt &val)
ContextModel3DBuffer m_cCUChromaPredSCModel
Void parseChromaQpAdjustment(TComDataCU *cu, UInt absPartIdx, UInt depth)
UChar * getExplicitRdpcmMode(ComponentID component)
const TComPPSRExt & getPpsRangeExtension() const
static const UChar INIT_SIG_FLAG[NUMBER_OF_SLICE_TYPES][(28+16)]
static const Int DM_CHROMA_IDX
chroma mode index for derived from luma intra mode
static const Int NUM_CHROMA_MODE
total number of chroma modes
const TComSPSRExt & getSpsRangeExtension() const
#define NUM_INTER_DIR_CTX
number of context models for inter prediction direction
ContextModel3DBuffer m_cCUTransSubdivFlagSCModel
Void setMergeFlagSubParts(Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
ContextModel3DBuffer m_cMVPIdxSCModel
#define NUM_MERGE_FLAG_EXT_CTX
number of context models for merge flag of merge extended
static const Int MLS_GRP_NUM
Max number of coefficient groups, max(16, 64)
#define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX
Bool getCabacInitPresentFlag() const
ContextModel3DBuffer m_explicitRdpcmDirSCModel
ChromaFormat GetChromaFormat() const
#define NUM_MVP_IDX_CTX
number of context models for MVP index
SChar * getPredictionMode()
UInt getNumPartitionsInCtu() const
Void setExplicitRdpcmModePartRange(UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Bool getMvdL1ZeroFlag() const
Void parseIntraDirLumaAng(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
ContextModel3DBuffer m_cCUMergeIdxExtSCModel
Void parseInterDir(TComDataCU *pcCU, UInt &ruiInterDir, UInt uiAbsPartIdx)
#define NUM_CTX_LAST_FLAG_XY
number of context models for last coefficient position
Void setTransformSkipPartRange(UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
#define NUM_SAO_TYPE_IDX_CTX
number of context models for SAO type index
#define NUM_PRED_MODE_CTX
number of context models for prediction mode
static const Int MIN_TU_SIZE
symmetric motion partition, 2Nx N
Void parseSaoTypeIdx(UInt &ruiVal)
static const UChar INIT_CHROMA_QP_ADJ_FLAG[NUMBER_OF_SLICE_TYPES][1]
ContextModel3DBuffer m_cCUSigCoeffGroupSCModel
UInt getMaxCUHeight() const
Void setCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
#define NUM_ONE_FLAG_CTX
number of context models for greater than 1 flag
UInt GetTransformDepthRel() const
Int getNumberValidComponents() const
UInt getCtxSkipFlag(UInt uiAbsPartIdx) const
Void parseSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
#define NUM_SKIP_FLAG_CTX
number of context models for skip flag
virtual Void decodeBinTrm(UInt &ruiBin)=0
static const UChar INIT_ABS_FLAG[NUMBER_OF_SLICE_TYPES][((1 *4)+(1 *2))]
UInt getLog2MaxTransformSkipBlockSize() const
static const UChar INIT_INTER_DIR[NUMBER_OF_SLICE_TYPES][5]
UInt getCtxInterDir(UInt uiAbsPartIdx) const
Int recon[MAX_NUM_CHANNEL_TYPE]
the bit depth as indicated in the SPS
Int getChromaQpOffsetListLen() const
static const UChar INIT_QT_ROOT_CBF[NUMBER_OF_SLICE_TYPES][1]
Int getNumRefIdx(RefPicList e) const
ContextModel3DBuffer m_cCUSkipFlagSCModel
#define NUM_SAO_MERGE_FLAG_CTX
number of context models for SAO merge flags
UInt getMinCUWidth() const
#define NUM_MV_RES_CTX
number of context models for motion vector difference
UInt getMaxTrSize() const
Bool getSignDataHidingEnabledFlag() const
static UInt getSigCoeffGroupCtxInc(const UInt *uiSigCoeffGroupFlag, const UInt uiCGPosX, const UInt uiCGPosY, const UInt widthInGroups, const UInt heightInGroups)
Void parseIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void getAllowedChromaDir(UInt uiAbsPartIdx, UInt *uiModeList) const
Void setCUTransquantBypassSubParts(Bool flag, UInt uiAbsPartIdx, UInt uiDepth)
ContextModel3DBuffer m_cCuCtxLastY
Void parseSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
UInt GetAbsPartIdxTU() const
Void xReadUnarySymbol(UInt &ruiSymbol, ContextModel *pcSCModel, Int iOffset)
static const UChar INIT_CHROMA_PRED_MODE[NUMBER_OF_SLICE_TYPES][2]
static const UChar INIT_MERGE_FLAG_EXT[NUMBER_OF_SLICE_TYPES][1]
#define NUM_ONE_FLAG_CTX_PER_SET
number of context models for greater than 1 flag in a set
#define RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(a)
ContextModel3DBuffer m_cCUQtRootCbfSCModel
ContextModel3DBuffer m_cCUDeltaQpSCModel
UInt getMaxTotalCUDepth() const
Void setChromaQpAdjSubParts(UChar val, Int absPartIdx, Int depth)
PartSize
supported partition shape
static const UChar INIT_TRANSFORMSKIP_FLAG[NUMBER_OF_SLICE_TYPES][2 *1]
Void setDepthSubParts(UInt uiDepth, UInt uiAbsPartIdx)
static const UChar INIT_SKIP_FLAG[NUMBER_OF_SLICE_TYPES][3]
UChar * getIntraDir(const ChannelType channelType) const
static const UChar INIT_QT_CBF[NUMBER_OF_SLICE_TYPES][2 *5]
Void parseMvd(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList)
Void resetEntropy(TComSlice *pSlice)
virtual Void decodeBin(UInt &ruiBin, ContextModel &rcCtxModel)=0
#define NUM_SIG_CG_FLAG_CTX
number of context models for MULTI_LEVEL_SIGNIFICANCE
UInt getGolombRiceStatisticsIndex(const ComponentID compID)
Void parseTransformSkipFlags(class TComTU &rTu, ComponentID component)
UInt getMaxNumMergeCand() const
ContextModel3DBuffer m_ChromaQpAdjFlagSCModel
Void load(const TDecSbac *pSrc)
symmetric motion partition, 2Nx2N
Void parseMergeFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx)
Void setCrossComponentPredictionAlphaPartRange(SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Int getQpBDOffset(ChannelType type) const
ContextModel3DBuffer m_cCUSigSCModel
Bool getUseTransformSkip() const
static const UChar INIT_PRED_MODE[NUMBER_OF_SLICE_TYPES][1]
Bool isIntra(UInt uiPartIdx) const
Void setPartSizeSubParts(PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth)
static const UChar INIT_CHROMA_QP_ADJ_IDC[NUMBER_OF_SLICE_TYPES][1]
#define NUM_CHROMA_PRED_CTX
number of context models for intra prediction (chroma)
TDecBinIf * m_pcTDecBinIf
ContextModel3DBuffer m_cTransformSkipSCModel
static const Int VER_IDX
index for intra VERTICAL mode
Void parseRefFrmIdx(TComDataCU *pcCU, Int &riRefFrmIdx, RefPicList eRefList)
static const UChar INIT_EXPLICIT_RDPCM_FLAG[NUMBER_OF_SLICE_TYPES][2 *1]
static const Int AMVP_MAX_NUM_CANDS
AMVP: advanced motion vector prediction - max number of final candidates.
static const Int RExt__GOLOMB_RICE_INCREMENT_DIVISOR
Void parseMergeIndex(TComDataCU *pcCU, UInt &ruiMergeIndex)
Void setIntraDirSubParts(const ChannelType channelType, const UInt uiDir, const UInt uiAbsPartIdx, const UInt uiDepth)
UInt getMinCUHeight() const
Bool isRDPCMEnabled(UInt uiAbsPartIdx) const
UInt getCtxSplitFlag(UInt uiAbsPartIdx, UInt uiDepth) const
asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2)
ContextModel3DBuffer m_cCUPredModeSCModel
static const UChar INIT_TRANS_SUBDIV_FLAG[NUMBER_OF_SLICE_TYPES][3]
asymmetric motion partition, (3N/2)x2N + ( N/2)x2N
ContextModel3DBuffer m_cCuCtxLastX
Void parsePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
#define NUM_REF_NO_CTX
number of context models for reference index
static const UChar INIT_SPLIT_FLAG[NUMBER_OF_SLICE_TYPES][3]
#define NUM_DELTA_QP_CTX
number of context models for dQP
Void getIntraDirPredictor(UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int *piMode=0) const
static const UChar INIT_DQP[NUMBER_OF_SLICE_TYPES][3]
ContextModel3DBuffer m_cCUQtCbfSCModel
static const Int CU_DQP_TU_CMAX
max number bins for truncated unary
Void parseCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
ContextModel3DBuffer m_cCUInterDirSCModel
#define NUM_EXPLICIT_RDPCM_FLAG_CTX
number of context models for the flag which specifies whether to use RDPCM on inter coded residues ...
static const UChar INIT_CROSS_COMPONENT_PREDICTION[NUMBER_OF_SLICE_TYPES][10]
Int TCoeff
transform coefficient
#define NUM_EXPLICIT_RDPCM_DIR_CTX
number of context models for the flag which specifies which RDPCM direction is used on inter coded re...
UInt m_golombRiceAdaptationStatistics[RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS]
Int getComponentScaleX(const ComponentID id) const
RefPicList
reference list index
Bool getCabacBypassAlignmentEnabledFlag() const
UInt getCoefficientOffset(const ComponentID compID) const
#define DTRACE_CABAC_VL(x)
static const UChar INIT_SIG_CG_FLAG[NUMBER_OF_SLICE_TYPES][2 *2]
Void parseSAOBlkParam(SAOBlkParam &saoBlkParam, Bool *sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, const BitDepths &bitDepths)
const TComRectangle & getRect(const ComponentID compID) const
ContextModel & get(UInt uiZ, UInt uiY, UInt uiX)
ContextModel3DBuffer m_ChromaQpAdjIdcSCModel
Int getMaxLog2TrDynamicRange(ChannelType channelType) const
ContextModel3DBuffer m_cCUAbsSCModel
Void setCodedChromaQpAdj(SChar qp)
UInt g_auiZscanToRaster[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
const TComPPS * getPPS() const
#define NUM_QT_CBF_CTX_PER_SET
number of context models for QT CBF
ContextModel3DBuffer m_cCUSplitFlagSCModel
Void setQPSubParts(Int qp, UInt uiAbsPartIdx, UInt uiDepth)
Void parseExplicitRdpcmMode(TComTU &rTu, ComponentID compID)
static const UChar INIT_MERGE_IDX_EXT[NUMBER_OF_SLICE_TYPES][1]
virtual Void copyState(const TDecBinIf *pcTDecBinIf)=0
static const UChar INIT_MVD[NUMBER_OF_SLICE_TYPES][2]
UChar * getTransformSkip(ComponentID compID)
Void parseSaoUflc(UInt uiLength, UInt &ruiVal)
Void setIPCMFlagSubParts(Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth)
#define DTRACE_CABAC_T(x)
ContextModel m_contextModels[512]
#define NUM_CTX_LAST_FLAG_SETS
Void xCopyContextsFrom(const TDecSbac *pSrc)
const UInt g_uiMinInGroup[LAST_SIGNIFICANT_GROUPS]
Void setSizeSubParts(UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth)
Int getLog2DiffMaxMinCodingBlockSize() const
Void parseDeltaQP(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Bool * getCUTransquantBypass()
#define NUM_ABS_FLAG_CTX
number of context models for greater than 2 flag
asymmetric motion partition, ( N/2)x2N + (3N/2)x2N
ContextModel3DBuffer m_cSaoTypeIdxSCModel
UInt GetAbsPartIdxNumParts() const
static const UChar INIT_ONE_FLAG[NUMBER_OF_SLICE_TYPES][((4 *4)+(4 *2))]
Void parseQtCbf(TComTU &rTu, const ComponentID compID, const Bool lowestLevel)
Void xCopyFrom(const TDecSbac *pSrc)
Void xReadUnaryMaxSymbol(UInt &ruiSymbol, ContextModel *pcSCModel, Int iOffset, UInt uiMaxSymbol)
static Int getMaxOffsetQVal(const Int channelBitDepth)
Void setAllMvd(TComMv const &rcMvd, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
ContextModel3DBuffer m_cCUOneSCModel
#define NUM_TRANS_SUBDIV_FLAG_CTX
number of context models for transform subdivision flags
static const UChar INIT_SAO_TYPE_IDX[NUMBER_OF_SLICE_TYPES][1]
ContextModel3DBuffer m_explicitRdpcmFlagSCModel
#define NUM_CROSS_COMPONENT_PREDICTION_CTX
#define NUM_CHROMA_QP_ADJ_IDC_CTX
number of context models for chroma_qp_adjustment_idc
const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]
const UInt g_uiGroupIdx[MAX_TU_SIZE]
Void parseSaoMerge(UInt &ruiVal)
static const UChar INIT_REF_PIC[NUMBER_OF_SLICE_TYPES][2]
#define NUM_TRANSFORMSKIP_FLAG_CTX
number of context models for transform skipping
Void parseCrossComponentPrediction(class TComTU &rTu, ComponentID compID)
ContextModel3DBuffer m_cCrossComponentPredictionSCModel
ContextModel3DBuffer m_CUTransquantBypassFlagSCModel
ContextModel3DBuffer m_cCUMvdSCModel
Void setCbfSubParts(const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth)
TComInputBitstream * m_pcBitstream
static Int calcPatternSigCtx(const UInt *sigCoeffGroupFlag, UInt uiCGPosX, UInt uiCGPosY, UInt widthInGroups, UInt heightInGroups)
UInt getCtxQtCbf(TComTU &rTu, const ChannelType chType) const
static const Int MLS_CG_SIZE
Coefficient group size of 4x4; = MLS_CG_LOG2_WIDTH + MLS_CG_LOG2_HEIGHT.
TComCUMvField * getCUMvField(RefPicList e)
Void xReadCoefRemainExGolomb(UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange)
TCoeff * getCoeff(ComponentID component)
Void parseRemainingBytes(Bool noTrailingBytesExpected)
static const UChar INIT_CU_TRANSQUANT_BYPASS_FLAG[NUMBER_OF_SLICE_TYPES][1]
#define DTRACE_CABAC_V(x)
#define NUM_INTRA_PREDICT_CTX
number of context models for intra prediction
Void parseTransformSubdivFlag(UInt &ruiSubdivFlag, UInt uiLog2TransformBlockSize)
Bool getCabacInitFlag()
get CABAC initial flag
#define MAX_NUM_CTX_MOD
maximum number of supported contexts
static const UChar INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][1]
basic motion vector class
static const Int RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS
UInt getPCMBitDepth(ChannelType type) const
static const UInt MAX_UINT
max. value of unsigned 32-bit integer
Int getComponentScaleY(const ComponentID id) const
PredMode
supported prediction type
static const UChar INIT_MVP_IDX[NUMBER_OF_SLICE_TYPES][1]
Void setPredModeSubParts(PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth)
Void xReadEpExGolomb(UInt &ruiSymbol, UInt uiCount)
transform and quantization class (header)
ContextModel3DBuffer m_cCURefPicSCModel
Void printSBACCoeffData(const UInt lastX, const UInt lastY, const UInt width, const UInt height, const UInt chan, const UInt absPart, const UInt scanIdx, const TCoeff *const pCoeff, const Bool finalEncode)
virtual Void decodeBinEP(UInt &ruiBin)=0
SChar getRefQP(UInt uiCurrAbsIdxInCtu) const
asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2)
#define NUM_QT_CBF_CTX_SETS
symmetric motion partition, Nx N
static const Int CU_DQP_EG_k
expgolomb order
Pel * getPCMSample(ComponentID component)
#define NUM_CHROMA_QP_ADJ_FLAG_CTX
number of context models for chroma_qp_adjustment_flag
#define NUM_PART_SIZE_CTX
number of context models for partition size
UInt g_auiRasterToPelX[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Void parseCoeffNxN(class TComTU &rTu, ComponentID compID)
ContextModel3DBuffer m_cCUIntraPredSCModel
static const UInt NUM_MOST_PROBABLE_MODES
#define NUM_MERGE_IDX_EXT_CTX
number of context models for merge index of merge extended
static const Int COEF_REMAIN_BIN_REDUCTION
indicates the level at which the VLC transitions from Golomb-Rice to TU+EG(k)
static Void IncrementStatisticEP(const TComCodingStatisticsClassType &stat, const Int numBits, const Int value)
#define NUM_ABS_FLAG_CTX_PER_SET
number of context models for greater than 2 flag in a set
#define NUM_SIG_FLAG_CTX
number of context models for sig flag
symmetric motion partition, Nx2N
Void setCodedQP(SChar qp)
Void bitwiseOrCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Void parseLastSignificantXY(UInt &uiPosLastX, UInt &uiPosLastY, Int width, Int height, ComponentID component, UInt uiScanIdx)
Void initBuffer(SliceType eSliceType, Int iQp, UChar *ctxModel)
initialize 3D buffer by slice type & QP
UInt g_auiRasterToPelY[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Bool getExtendedPrecisionProcessingFlag() const
static const UChar INIT_EXPLICIT_RDPCM_DIR[NUMBER_OF_SLICE_TYPES][2 *1]
#define NUM_SPLIT_FLAG_CTX
number of context models for split flag
ContextModel3DBuffer m_cCUPartSizeSCModel
UInt GetTransformDepthTotal() const
UInt getMaxCUWidth() const
const TComSPS * getSPS() const
Void parseSaoMaxUvlc(UInt &val, UInt maxSymbol)
Void parsePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
virtual Void decodeBinsEP(UInt &ruiBins, Int numBins)=0
static const Int SBH_THRESHOLD
value of the fixed SBH controlling threshold
static const Int C1FLAG_NUMBER
UInt GetTransformDepthTotalAdj(const ComponentID compID) const
Void setTrIdxSubParts(UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth)