本文整理汇总了C++中TComSlice::getSliceQpDeltaCr方法的典型用法代码示例。如果您正苦于以下问题:C++ TComSlice::getSliceQpDeltaCr方法的具体用法?C++ TComSlice::getSliceQpDeltaCr怎么用?C++ TComSlice::getSliceQpDeltaCr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TComSlice
的用法示例。
在下文中一共展示了TComSlice::getSliceQpDeltaCr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLambda
void FrameEncoder::setLambda(int qp, int row)
{
TComSlice* slice = m_pic->getSlice();
TComPicYuv *fenc = slice->getPic()->getPicYuvOrg();
double lambda = 0;
if (m_pic->getSlice()->getSliceType() == I_SLICE)
{
lambda = X265_MAX(1, x265_lambda2_tab_I[qp]);
}
else
{
lambda = X265_MAX(1, x265_lambda2_non_I[qp]);
}
// for RDO
// in RdCost there is only one lambda because the luma and chroma bits are not separated,
// instead we weight the distortion of chroma.
int chromaQPOffset = slice->getPPS()->getChromaCbQpOffset() + slice->getSliceQpDeltaCb();
int qpc = Clip3(0, 70, qp + chromaQPOffset);
double cbWeight = pow(2.0, (qp - g_chromaScale[qpc])); // takes into account of the chroma qp mapping and chroma qp Offset
chromaQPOffset = slice->getPPS()->getChromaCrQpOffset() + slice->getSliceQpDeltaCr();
qpc = Clip3(0, 70, qp + chromaQPOffset);
double crWeight = pow(2.0, (qp - g_chromaScale[qpc])); // takes into account of the chroma qp mapping and chroma qp Offset
double chromaLambda = lambda / crWeight;
m_rows[row].m_search.setQPLambda(qp, lambda, chromaLambda);
m_rows[row].m_search.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
m_rows[row].m_rdCost.setLambda(lambda);
m_rows[row].m_rdCost.setCbDistortionWeight(cbWeight);
m_rows[row].m_rdCost.setCrDistortionWeight(crWeight);
}
示例2: compressFrame
void FrameEncoder::compressFrame()
{
PPAScopeEvent(FrameEncoder_compressFrame);
int64_t startCompressTime = x265_mdate();
TEncEntropy* entropyCoder = getEntropyCoder(0);
TComSlice* slice = m_pic->getSlice();
m_nalCount = 0;
int qp = slice->getSliceQp();
double lambda = 0;
if (slice->getSliceType() == I_SLICE)
{
lambda = X265_MAX(1, x265_lambda2_tab_I[qp]);
}
else
{
lambda = X265_MAX(1, x265_lambda2_non_I[qp]);
}
// for RDO
// in RdCost there is only one lambda because the luma and chroma bits are not separated,
// instead we weight the distortion of chroma.
int qpc;
int chromaQPOffset = slice->getPPS()->getChromaCbQpOffset() + slice->getSliceQpDeltaCb();
qpc = Clip3(0, 57, qp + chromaQPOffset);
double cbWeight = pow(2.0, (qp - g_chromaScale[qpc])); // takes into account of the chroma qp mapping and chroma qp Offset
chromaQPOffset = slice->getPPS()->getChromaCrQpOffset() + slice->getSliceQpDeltaCr();
qpc = Clip3(0, 57, qp + chromaQPOffset);
double crWeight = pow(2.0, (qp - g_chromaScale[qpc])); // takes into account of the chroma qp mapping and chroma qp Offset
double chromaLambda = lambda / crWeight;
TComPicYuv *fenc = slice->getPic()->getPicYuvOrg();
for (int i = 0; i < m_numRows; i++)
{
m_rows[i].m_search.setQPLambda(qp, lambda, chromaLambda);
m_rows[i].m_search.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
m_rows[i].m_rdCost.setLambda(lambda);
m_rows[i].m_rdCost.setCbDistortionWeight(cbWeight);
m_rows[i].m_rdCost.setCrDistortionWeight(crWeight);
}
m_frameFilter.m_sao.lumaLambda = lambda;
m_frameFilter.m_sao.chromaLambda = chromaLambda;
switch (slice->getSliceType())
{
case I_SLICE:
m_frameFilter.m_sao.depth = 0;
break;
case P_SLICE:
m_frameFilter.m_sao.depth = 1;
break;
case B_SLICE:
m_frameFilter.m_sao.depth = 2 + !slice->isReferenced();
break;
}
slice->setSliceQpDelta(0);
slice->setSliceQpDeltaCb(0);
slice->setSliceQpDeltaCr(0);
int numSubstreams = m_cfg->param.bEnableWavefront ? m_pic->getPicSym()->getFrameHeightInCU() : 1;
// TODO: these two items can likely be FrameEncoder member variables to avoid re-allocs
TComOutputBitstream* bitstreamRedirect = new TComOutputBitstream;
TComOutputBitstream* outStreams = new TComOutputBitstream[numSubstreams];
if (m_cfg->getUseASR() && !slice->isIntra())
{
int pocCurr = slice->getPOC();
int maxSR = m_cfg->param.searchRange;
int numPredDir = slice->isInterP() ? 1 : 2;
for (int dir = 0; dir <= numPredDir; dir++)
{
for (int refIdx = 0; refIdx < slice->getNumRefIdx(dir); refIdx++)
{
int refPOC = slice->getRefPic(dir, refIdx)->getPOC();
int newSR = Clip3(8, maxSR, (maxSR * ADAPT_SR_SCALE * abs(pocCurr - refPOC) + 4) >> 3);
for (int i = 0; i < m_numRows; i++)
{
m_rows[i].m_search.setAdaptiveSearchRange(dir, refIdx, newSR);
}
}
}
}