HEVC Test Model (HM)
HM-16.18
|
transform and quantization class More...
#include <TComTrQuant.h>
Public Member Functions | |
Void | setLambdas (const Double lambdas[MAX_NUM_COMPONENT]) |
Void | selectLambda (const ComponentID compIdx) |
Void | setRDOQOffset (UInt uiRDOQOffset) |
Double * | getErrScaleCoeff (UInt list, UInt size, Int qp) |
Double & | getErrScaleCoeffNoScalingList (UInt list, UInt size, Int qp) |
get Error Scale Coefficent More... | |
Int * | getQuantCoeff (UInt list, Int qp, UInt size) |
get Error Scale Coefficent More... | |
Int * | getDequantCoeff (UInt list, Int qp, UInt size) |
get Quant Coefficent More... | |
Void | setUseScalingList (Bool bUseScalingList) |
get DeQuant Coefficent More... | |
Bool | getUseScalingList (const UInt width, const UInt height, const Bool isTransformSkip) |
Int | getQpDelta (Int qp) |
Int * | getSliceNSamples () |
Double * | getSliceSumC () |
Public Attributes | |
estBitsSbacStruct * | m_pcEstBitsSbac |
Protected Attributes | |
Int | m_qpDelta [MAX_QP+1] |
Int | m_sliceNsamples [LEVEL_RANGE+1] |
Double | m_sliceSumC [LEVEL_RANGE+1] |
TCoeff * | m_plTempCoeff |
Double | m_lambdas [MAX_NUM_COMPONENT] |
Double | m_dLambda |
UInt | m_uiRDOQOffset |
UInt | m_uiMaxTrSize |
Bool | m_bEnc |
Bool | m_useRDOQ |
Bool | m_useRDOQTS |
Bool | m_useSelectiveRDOQ |
Bool | m_bUseAdaptQpSelect |
Bool | m_useTransformSkipFast |
Bool | m_scalingListEnabledFlag |
Int * | m_quantCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM] |
array of quantization matrix coefficient 4x4 More... | |
Int * | m_dequantCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM] |
array of dequantization matrix coefficient 4x4 More... | |
Double * | m_errScale [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM] |
array of quantization matrix coefficient 4x4 More... | |
Double | m_errScaleNoScalingList [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM] |
array of quantization matrix coefficient 4x4 More... | |
TComTrQuant () | |
~TComTrQuant () | |
Void | init (UInt uiMaxTrSize, Bool useRDOQ=false, Bool useRDOQTS=false, Bool useSelectiveRDOQ=false, Bool bEnc=false, Bool useTransformSkipFast=false, Bool bUseAdaptQpSelect=false) |
Void | transformNxN (TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, TCoeff *rpcCoeff, TCoeff *rpcArlCoeff, TCoeff &uiAbsSum, const QpParam &cQP) |
Void | invTransformNxN (TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, TCoeff *pcCoeff, const QpParam &cQP) |
Void | invRecurTransformNxN (const ComponentID compID, TComYuv *pResidual, TComTU &rTu) |
Void | rdpcmNxN (TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, const QpParam &cQP, TCoeff *pcCoeff, TCoeff &uiAbsSum, RDPCMMode &rdpcmMode) |
Void | invRdpcmNxN (TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride) |
Void | applyForwardRDPCM (TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, const QpParam &cQP, TCoeff *pcCoeff, TCoeff &uiAbsSum, const RDPCMMode mode) |
Void | initScalingList () |
Void | destroyScalingList () |
Void | setErrScaleCoeff (UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) |
Void | setFlatScalingList (const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) |
Void | xsetFlatScalingList (UInt list, UInt size, Int qp) |
Void | xSetScalingListEnc (TComScalingList *scalingList, UInt list, UInt size, Int qp) |
Void | xSetScalingListDec (const TComScalingList &scalingList, UInt list, UInt size, Int qp) |
Void | setScalingList (TComScalingList *scalingList, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) |
Void | setScalingListDec (const TComScalingList &scalingList) |
Void | processScalingListEnc (Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc) |
Void | processScalingListDec (const Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc) |
Void | initSliceQpDelta () |
Void | storeSliceQpNext (TComSlice *pcSlice) |
Void | clearSliceARLCnt () |
Void | transformSkipQuantOneSample (TComTU &rTu, const ComponentID compID, const TCoeff resiDiff, TCoeff *pcCoeff, const UInt uiPos, const QpParam &cQP, const Bool bUseHalfRoundingPoint) |
Void | invTrSkipDeQuantOneSample (TComTU &rTu, ComponentID compID, TCoeff pcCoeff, Pel &reconSample, const QpParam &cQP, UInt uiPos) |
static Int | calcPatternSigCtx (const UInt *sigCoeffGroupFlag, UInt uiCGPosX, UInt uiCGPosY, UInt widthInGroups, UInt heightInGroups) |
static Int | getSigCtxInc (Int patternSigCtx, const TUEntropyCodingParameters &codingParameters, const Int scanPosition, const Int log2BlockWidth, const Int log2BlockHeight, const ChannelType chanType) |
static UInt | getSigCoeffGroupCtxInc (const UInt *uiSigCoeffGroupFlag, const UInt uiCGPosX, const UInt uiCGPosY, const UInt widthInGroups, const UInt heightInGroups) |
static Void | crossComponentPrediction (TComTU &rTu, const ComponentID compID, const Pel *piResiL, const Pel *piResiC, Pel *piResiT, const Int width, const Int height, const Int strideL, const Int strideC, const Int strideT, const Bool reverse) |
Void | xT (const Int channelBitDepth, Bool useDST, Pel *piBlkResi, UInt uiStride, TCoeff *psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange) |
Void | xTransformSkip (Pel *piBlkResi, UInt uiStride, TCoeff *psCoeff, TComTU &rTu, const ComponentID component) |
Void | signBitHidingHDQ (TCoeff *pQCoef, TCoeff *pCoef, TCoeff *deltaU, const TUEntropyCodingParameters &codingParameters, const Int maxLog2TrDynamicRange) |
Void | xQuant (TComTU &rTu, TCoeff *pSrc, TCoeff *pDes, TCoeff *pArlDes, TCoeff &uiAbsSum, const ComponentID compID, const QpParam &cQP) |
Bool | xNeedRDOQ (TComTU &rTu, TCoeff *pSrc, const ComponentID compID, const QpParam &cQP) |
Void | xRateDistOptQuant (TComTU &rTu, TCoeff *plSrcCoeff, TCoeff *piDstCoeff, TCoeff *piArlDstCoeff, TCoeff &uiAbsSum, const ComponentID compID, const QpParam &cQP) |
__inline UInt | xGetCodedLevel (Double &rd64CodedCost, Double &rd64CodedCost0, Double &rd64CodedCostSig, Intermediate_Int lLevelDouble, UInt uiMaxAbsLevel, UShort ui16CtxNumSig, UShort ui16CtxNumOne, UShort ui16CtxNumAbs, UShort ui16AbsGoRice, UInt c1Idx, UInt c2Idx, Int iQBits, Double errorScale, Bool bLast, Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange) const |
__inline Int | xGetICRate (const UInt uiAbsLevel, const UShort ui16CtxNumOne, const UShort ui16CtxNumAbs, const UShort ui16AbsGoRice, const UInt c1Idx, const UInt c2Idx, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange) const |
__inline Double | xGetRateLast (const UInt uiPosX, const UInt uiPosY, const ComponentID component) const |
__inline Double | xGetRateSigCoeffGroup (UShort uiSignificanceCoeffGroup, UShort ui16CtxNumSig) const |
__inline Double | xGetRateSigCoef (UShort uiSignificance, UShort ui16CtxNumSig) const |
__inline Double | xGetICost (Double dRate) const |
__inline Double | xGetIEPRate () const |
Void | xDeQuant (TComTU &rTu, const TCoeff *pSrc, TCoeff *pDes, const ComponentID compID, const QpParam &cQP) |
Void | xIT (const Int channelBitDepth, Bool useDST, TCoeff *plCoef, Pel *pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange) |
Void | xITransformSkip (TCoeff *plCoef, Pel *pResidual, UInt uiStride, TComTU &rTu, const ComponentID component) |
transform and quantization class
Definition at line 98 of file TComTrQuant.h.
TComTrQuant::TComTrQuant | ( | ) |
Definition at line 126 of file TComTrQuant.cpp.
TComTrQuant::~TComTrQuant | ( | ) |
Definition at line 136 of file TComTrQuant.cpp.
Void TComTrQuant::applyForwardRDPCM | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
Pel * | pcResidual, | ||
const UInt | uiStride, | ||
const QpParam & | cQP, | ||
TCoeff * | pcCoeff, | ||
TCoeff & | uiAbsSum, | ||
const RDPCMMode | mode | ||
) |
Definition at line 1739 of file TComTrQuant.cpp.
|
static |
Pattern decision for context derivation process of significant_coeff_flag
sigCoeffGroupFlag | pointer to prior coded significant coeff group |
uiCGPosX | column of current coefficient group |
uiCGPosY | row of current coefficient group |
widthInGroups | width of the block |
heightInGroups | height of the block |
Definition at line 2672 of file TComTrQuant.cpp.
Void TComTrQuant::clearSliceARLCnt | ( | ) |
Definition at line 219 of file TComTrQuant.cpp.
|
static |
Definition at line 3474 of file TComTrQuant.cpp.
Void TComTrQuant::destroyScalingList | ( | ) |
destroy quantization matrix array
Definition at line 3291 of file TComTrQuant.cpp.
get Quant Coefficent
Definition at line 179 of file TComTrQuant.h.
Definition at line 176 of file TComTrQuant.h.
get Error Scale Coefficent
Definition at line 177 of file TComTrQuant.h.
Definition at line 194 of file TComTrQuant.h.
get Error Scale Coefficent
Definition at line 178 of file TComTrQuant.h.
|
static |
Context derivation process of coeff_abs_significant_flag
uiSigCoeffGroupFlag | significance map of L1 |
uiCGPosX | column of current scan position |
uiCGPosY | row of current scan position |
widthInGroups | width of the block |
heightInGroups | height of the block |
Definition at line 3023 of file TComTrQuant.cpp.
|
static |
Context derivation process of coeff_abs_significant_flag
patternSigCtx | pattern for current coefficient group |
codingParameters | coding parameters for the TU (includes the scan) |
scanPosition | current position in scan order |
log2BlockWidth | log2 width of the block |
log2BlockHeight | log2 height of the block |
chanType | channel type (CHANNEL_TYPE_LUMA/CHROMA) |
Definition at line 2707 of file TComTrQuant.cpp.
|
inline |
Definition at line 195 of file TComTrQuant.h.
|
inline |
Definition at line 196 of file TComTrQuant.h.
|
inline |
Definition at line 181 of file TComTrQuant.h.
Void TComTrQuant::init | ( | UInt | uiMaxTrSize, |
Bool | useRDOQ = false , |
||
Bool | useRDOQTS = false , |
||
Bool | useSelectiveRDOQ = false , |
||
Bool | bEnc = false , |
||
Bool | useTransformSkipFast = false , |
||
Bool | bUseAdaptQpSelect = false |
||
) |
Definition at line 1427 of file TComTrQuant.cpp.
Void TComTrQuant::initScalingList | ( | ) |
initialization process of scaling list array
Definition at line 3273 of file TComTrQuant.cpp.
Void TComTrQuant::initSliceQpDelta | ( | ) |
Definition at line 211 of file TComTrQuant.cpp.
Void TComTrQuant::invRdpcmNxN | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
Pel * | pcResidual, | ||
const UInt | uiStride | ||
) |
Definition at line 1863 of file TComTrQuant.cpp.
Void TComTrQuant::invRecurTransformNxN | ( | const ComponentID | compID, |
TComYuv * | pResidual, | ||
TComTU & | rTu | ||
) |
Definition at line 1668 of file TComTrQuant.cpp.
Void TComTrQuant::invTransformNxN | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
Pel * | pcResidual, | ||
const UInt | uiStride, | ||
TCoeff * | pcCoeff, | ||
const QpParam & | cQP | ||
) |
Definition at line 1537 of file TComTrQuant.cpp.
Void TComTrQuant::invTrSkipDeQuantOneSample | ( | TComTU & | rTu, |
ComponentID | compID, | ||
TCoeff | pcCoeff, | ||
Pel & | reconSample, | ||
const QpParam & | cQP, | ||
UInt | uiPos | ||
) |
Definition at line 3374 of file TComTrQuant.cpp.
Void TComTrQuant::processScalingListDec | ( | const Int * | coeff, |
Int * | dequantcoeff, | ||
Int | invQuantScales, | ||
UInt | height, | ||
UInt | width, | ||
UInt | ratio, | ||
Int | sizuNum, | ||
UInt | dc | ||
) |
set quantized matrix coefficient for decode
coeff | quantaized matrix address |
dequantcoeff | quantaized matrix address |
invQuantScales | IQ(QP%6)) |
height | height |
width | width |
ratio | ratio for upscale |
sizuNum | matrix size |
dc | dc parameter |
Definition at line 3255 of file TComTrQuant.cpp.
Void TComTrQuant::processScalingListEnc | ( | Int * | coeff, |
Int * | quantcoeff, | ||
Int | quantScales, | ||
UInt | height, | ||
UInt | width, | ||
UInt | ratio, | ||
Int | sizuNum, | ||
UInt | dc | ||
) |
set quantized matrix coefficient for encode
coeff | quantaized matrix address |
quantcoeff | quantaized matrix address |
quantScales | Q(QP%6) |
height | height |
width | width |
ratio | ratio for upscale |
sizuNum | matrix size |
dc | dc parameter |
Definition at line 3229 of file TComTrQuant.cpp.
Void TComTrQuant::rdpcmNxN | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
Pel * | pcResidual, | ||
const UInt | uiStride, | ||
const QpParam & | cQP, | ||
TCoeff * | pcCoeff, | ||
TCoeff & | uiAbsSum, | ||
RDPCMMode & | rdpcmMode | ||
) |
Definition at line 1794 of file TComTrQuant.cpp.
|
inline |
Definition at line 149 of file TComTrQuant.h.
Void TComTrQuant::setErrScaleCoeff | ( | UInt | list, |
UInt | size, | ||
Int | qp, | ||
const Int | maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], | ||
const BitDepths & | bitDepths | ||
) |
set error scale coefficients
list | list ID |
size | |
qp | quantization parameter |
maxLog2TrDynamicRange | |
bitDepths | reference to bit depth array for all channels |
Definition at line 3096 of file TComTrQuant.cpp.
Void TComTrQuant::setFlatScalingList | ( | const Int | maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], |
const BitDepths & | bitDepths | ||
) |
set flat matrix value to quantized coefficient
Definition at line 3176 of file TComTrQuant.cpp.
Definition at line 148 of file TComTrQuant.h.
Definition at line 153 of file TComTrQuant.h.
Void TComTrQuant::setScalingList | ( | TComScalingList * | scalingList, |
const Int | maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], | ||
const BitDepths & | bitDepths | ||
) |
set quantized matrix coefficient for encode
scalingList | quantized matrix address |
format | chroma format |
maxLog2TrDynamicRange | |
bitDepths | reference to bit depth array for all channels |
Definition at line 3051 of file TComTrQuant.cpp.
Void TComTrQuant::setScalingListDec | ( | const TComScalingList & | scalingList | ) |
set quantized matrix coefficient for decode
scalingList | quantized matrix address |
format | chroma format |
Definition at line 3073 of file TComTrQuant.cpp.
get DeQuant Coefficent
Definition at line 180 of file TComTrQuant.h.
|
private |
Definition at line 991 of file TComTrQuant.cpp.
Definition at line 154 of file TComTrQuant.cpp.
Void TComTrQuant::transformNxN | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
Pel * | pcResidual, | ||
const UInt | uiStride, | ||
TCoeff * | rpcCoeff, | ||
TCoeff * | rpcArlCoeff, | ||
TCoeff & | uiAbsSum, | ||
const QpParam & | cQP | ||
) |
Definition at line 1450 of file TComTrQuant.cpp.
Void TComTrQuant::transformSkipQuantOneSample | ( | TComTU & | rTu, |
const ComponentID | compID, | ||
const TCoeff | resiDiff, | ||
TCoeff * | pcCoeff, | ||
const UInt | uiPos, | ||
const QpParam & | cQP, | ||
const Bool | bUseHalfRoundingPoint | ||
) |
Definition at line 3316 of file TComTrQuant.cpp.
|
private |
Definition at line 1308 of file TComTrQuant.cpp.
|
private |
Get the best level in RD sense
This method calculates the best quantized transform level for a given scan position.
Definition at line 2812 of file TComTrQuant.cpp.
Get the cost for a specific rate
dRate | rate of a bit |
Definition at line 3002 of file TComTrQuant.cpp.
|
private |
Calculates the cost for specific absolute transform level
uiAbsLevel | scaled quantized level |
ui16CtxNumOne | current ctxInc for coeff_abs_level_greater1 (1st bin of coeff_abs_level_minus1 in AVC) |
ui16CtxNumAbs | current ctxInc for coeff_abs_level_greater2 (remaining bins of coeff_abs_level_minus1 in AVC) |
ui16AbsGoRice | Rice parameter for coeff_abs_level_minus3 |
c1Idx | |
c2Idx | |
useLimitedPrefixLength | |
maxLog2TrDynamicRange |
Definition at line 2881 of file TComTrQuant.cpp.
|
private |
Get the cost of an equal probable bit
Definition at line 3010 of file TComTrQuant.cpp.
|
private |
Calculates the cost of signaling the last significant coefficient in the block
uiPosX | X coordinate of the last significant coefficient |
uiPosY | Y coordinate of the last significant coefficient |
component | colour component ID |
Definition at line 2972 of file TComTrQuant.cpp.
|
private |
Definition at line 2992 of file TComTrQuant.cpp.
|
private |
Definition at line 2957 of file TComTrQuant.cpp.
|
private |
Wrapper function between HM interface and core NxN inverse transform (2D)
channelBitDepth | bit depth of channel |
useDST | |
plCoef | input data (transform coefficients) |
pResidual | output data (residual) |
uiStride | stride of input residual data |
iWidth | transform width |
iHeight | transform height |
maxLog2TrDynamicRange |
Definition at line 1978 of file TComTrQuant.cpp.
|
private |
Wrapper function between HM interface and core NxN transform skipping
plCoef | input data (coefficients) |
pResidual | output data (residual) |
uiStride | stride of input residual data |
rTu | reference to transform data |
component | colour component ID |
Definition at line 2060 of file TComTrQuant.cpp.
|
private |
Definition at line 1252 of file TComTrQuant.cpp.
|
private |
Definition at line 1126 of file TComTrQuant.cpp.
|
private |
RDOQ with CABAC
rTu | reference to transform data |
plSrcCoeff | pointer to input buffer |
piDstCoeff | reference to pointer to output buffer |
piArlDstCoeff | |
uiAbsSum | reference to absolute sum of quantized transform coefficient |
compID | colour component ID |
cQP | reference to quantization parameters |
Rate distortion optimized quantization for entropy coding engines using probability models like CABAC
Definition at line 2119 of file TComTrQuant.cpp.
set flat matrix value to quantized coefficient
list | List ID |
size | size index |
qp | Quantization parameter |
format | chroma format |
Definition at line 3200 of file TComTrQuant.cpp.
Void TComTrQuant::xSetScalingListDec | ( | const TComScalingList & | scalingList, |
UInt | listId, | ||
UInt | sizeId, | ||
Int | qp | ||
) |
set quantized matrix coefficient for decode
scalingList | quantaized matrix address |
listId | List index |
sizeId | size index |
qp | Quantization parameter |
format | chroma format |
Definition at line 3154 of file TComTrQuant.cpp.
Void TComTrQuant::xSetScalingListEnc | ( | TComScalingList * | scalingList, |
UInt | listId, | ||
UInt | sizeId, | ||
Int | qp | ||
) |
set quantized matrix coefficient for encode
scalingList | quantized matrix address |
listId | List index |
sizeId | size index |
qp | Quantization parameter |
format | chroma format |
Definition at line 3128 of file TComTrQuant.cpp.
|
private |
Wrapper function between HM interface and core NxN forward transform (2D)
channelBitDepth | bit depth of channel |
useDST | |
piBlkResi | input data (residual) |
uiStride | stride of input residual data |
psCoeff | output data (transform coefficients) |
iWidth | transform width |
iHeight | transform height |
maxLog2TrDynamicRange |
Definition at line 1942 of file TComTrQuant.cpp.
|
private |
Wrapper function between HM interface and core 4x4 transform skipping
piBlkResi | input data (residual) |
uiStride | stride of input residual data |
psCoeff | output data (transform coefficients) |
rTu | reference to transform data |
component | colour component |
Definition at line 2011 of file TComTrQuant.cpp.
|
protected |
Definition at line 216 of file TComTrQuant.h.
|
protected |
Definition at line 221 of file TComTrQuant.h.
|
protected |
array of dequantization matrix coefficient 4x4
Definition at line 228 of file TComTrQuant.h.
|
protected |
Definition at line 213 of file TComTrQuant.h.
|
protected |
array of quantization matrix coefficient 4x4
Definition at line 229 of file TComTrQuant.h.
|
protected |
array of quantization matrix coefficient 4x4
Definition at line 230 of file TComTrQuant.h.
|
protected |
Definition at line 211 of file TComTrQuant.h.
estBitsSbacStruct* TComTrQuant::m_pcEstBitsSbac |
Definition at line 155 of file TComTrQuant.h.
|
protected |
Definition at line 207 of file TComTrQuant.h.
Definition at line 203 of file TComTrQuant.h.
|
protected |
array of quantization matrix coefficient 4x4
Definition at line 227 of file TComTrQuant.h.
|
protected |
Definition at line 225 of file TComTrQuant.h.
|
protected |
Definition at line 204 of file TComTrQuant.h.
|
protected |
Definition at line 205 of file TComTrQuant.h.
|
protected |
Definition at line 215 of file TComTrQuant.h.
|
protected |
Definition at line 214 of file TComTrQuant.h.
|
protected |
Definition at line 217 of file TComTrQuant.h.
|
protected |
Definition at line 218 of file TComTrQuant.h.
|
protected |
Definition at line 219 of file TComTrQuant.h.
|
protected |
Definition at line 223 of file TComTrQuant.h.