本文整理汇总了C++中TComSlice::isInterB方法的典型用法代码示例。如果您正苦于以下问题:C++ TComSlice::isInterB方法的具体用法?C++ TComSlice::isInterB怎么用?C++ TComSlice::isInterB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TComSlice
的用法示例。
在下文中一共展示了TComSlice::isInterB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode
//.........这里部分代码省略.........
m_cSliceDecoder.create( m_apcSlicePilot, m_apcSlicePilot->getSPS()->getWidth(), m_apcSlicePilot->getSPS()->getHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
}
// Set picture slice pointer
TComSlice* pcSlice = m_apcSlicePilot;
Bool bNextSlice = pcSlice->isNextSlice();
if (m_bFirstSliceInPicture)
{
if(pcPic->getNumAllocatedSlice() != 1)
{
pcPic->clearSliceBuffer();
}
}
else
{
pcPic->allocateNewSlice();
}
assert(pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
m_apcSlicePilot = pcPic->getPicSym()->getSlice(m_uiSliceIdx);
pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx);
pcPic->setTLayer(nalu.m_TemporalID);
if (bNextSlice)
{
// Do decoding refresh marking if any
pcSlice->decodingRefreshMarking(m_uiPOCCDR, m_bRefreshPending, m_cListPic);
// Set reference list
pcSlice->setRefPicList( m_cListPic );
// HierP + GPB case
if ( m_cSPS.getUseLDC() && pcSlice->isInterB() )
{
if(pcSlice->getRefPicListCombinationFlag() && (pcSlice->getNumRefIdx(REF_PIC_LIST_0) > pcSlice->getNumRefIdx(REF_PIC_LIST_1)))
{
for (Int iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1); iRefIdx++)
{
pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx);
}
}
else
{
Int iNumRefIdx = pcSlice->getNumRefIdx(REF_PIC_LIST_0);
pcSlice->setNumRefIdx( REF_PIC_LIST_1, iNumRefIdx );
for (Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++)
{
pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx);
}
}
}
// For generalized B
// note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
if (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0)
{
Int iNumRefIdx = pcSlice->getNumRefIdx(REF_PIC_LIST_0);
pcSlice->setNumRefIdx ( REF_PIC_LIST_1, iNumRefIdx );
for (Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++)
{
pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx);
}
}
示例2: prepareEncode
//.........这里部分代码省略.........
case NAL_UNIT_CODED_SLICE_RADL_R:
slice->setNalUnitType(NAL_UNIT_CODED_SLICE_RADL_N);
break;
case NAL_UNIT_CODED_SLICE_RASL_R:
slice->setNalUnitType(NAL_UNIT_CODED_SLICE_RASL_N);
break;
default:
break;
}
}
// Do decoding refresh marking if any
decodingRefreshMarking(pocCurr, slice->getNalUnitType());
computeRPS(pocCurr, slice->isIRAP(), slice->getLocalRPS(), slice->getSPS()->getMaxDecPicBuffering(0));
slice->setRPS(slice->getLocalRPS());
slice->setRPSidx(-1); // Force use of RPS from slice, rather than from SPS
applyReferencePictureSet(slice->getRPS(), pocCurr); // Mark pictures in m_piclist as unreferenced if they are not included in RPS
arrangeLongtermPicturesInRPS(slice);
slice->setNumRefIdx(REF_PIC_LIST_0, X265_MIN(m_maxRefL0, slice->getRPS()->getNumberOfNegativePictures())); // Ensuring L0 contains just the -ve POC
slice->setNumRefIdx(REF_PIC_LIST_1, X265_MIN(m_maxRefL1, slice->getRPS()->getNumberOfPositivePictures()));
slice->setRefPicList(m_picList);
// Slice type refinement
if ((slice->getSliceType() == B_SLICE) && (slice->getNumRefIdx(REF_PIC_LIST_1) == 0))
{
slice->setSliceType(P_SLICE);
}
if (slice->getSliceType() == B_SLICE)
{
// TODO: Can we estimate this from lookahead?
slice->setColFromL0Flag(0);
bool bLowDelay = true;
int curPOC = slice->getPOC();
int refIdx = 0;
for (refIdx = 0; refIdx < slice->getNumRefIdx(REF_PIC_LIST_0) && bLowDelay; refIdx++)
{
if (slice->getRefPic(REF_PIC_LIST_0, refIdx)->getPOC() > curPOC)
{
bLowDelay = false;
}
}
for (refIdx = 0; refIdx < slice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; refIdx++)
{
if (slice->getRefPic(REF_PIC_LIST_1, refIdx)->getPOC() > curPOC)
{
bLowDelay = false;
}
}
slice->setCheckLDC(bLowDelay);
}
else
{
slice->setCheckLDC(true);
}
slice->setRefPOCList();
slice->setEnableTMVPFlag(1);
bool bGPBcheck = false;
if (slice->getSliceType() == B_SLICE)
{
if (slice->getNumRefIdx(REF_PIC_LIST_0) == slice->getNumRefIdx(REF_PIC_LIST_1))
{
bGPBcheck = true;
for (int i = 0; i < slice->getNumRefIdx(REF_PIC_LIST_1); i++)
{
if (slice->getRefPOC(REF_PIC_LIST_1, i) != slice->getRefPOC(REF_PIC_LIST_0, i))
{
bGPBcheck = false;
break;
}
}
}
}
slice->setMvdL1ZeroFlag(bGPBcheck);
slice->setNextSlice(false);
/* Increment reference count of all motion-referenced frames. This serves two purposes. First
* it prevents the frame from being recycled, and second the referenced frames know how many
* other FrameEncoders are using them for motion reference */
int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0;
for (int l = 0; l < numPredDir; l++)
{
for (int ref = 0; ref < slice->getNumRefIdx(l); ref++)
{
TComPic *refpic = slice->getRefPic(l, ref);
ATOMIC_INC(&refpic->m_countRefEncoders);
}
}
}
示例3: xDecodeSlice
//.........这里部分代码省略.........
{
m_prevPOC = m_apcSlicePilot->getPOC();
}
// actual decoding starts here
xActivateParameterSets();
m_bFirstSliceInSequence = false;
m_bFirstSliceInBitstream = false;
TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx);
// When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses.
// Now, having set up the maps, convert them to the correct form.
pcSlice->setSliceSegmentCurStartCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()) );
pcSlice->setSliceSegmentCurEndCtuTsAddr( m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceSegmentCurEndCtuTsAddr()) );
if(!pcSlice->getDependentSliceSegmentFlag())
{
pcSlice->setSliceCurStartCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurStartCtuTsAddr()));
pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr()));
}
m_pcPic->setTLayer(nalu.m_temporalId);
if (!pcSlice->getDependentSliceSegmentFlag())
{
pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic );
// Set reference list
pcSlice->setRefPicList( m_cListPic, true );
// For generalized B
// note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
if (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0)
{
Int iNumRefIdx = pcSlice->getNumRefIdx(REF_PIC_LIST_0);
pcSlice->setNumRefIdx ( REF_PIC_LIST_1, iNumRefIdx );
for (Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++)
{
pcSlice->setRefPic(pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx), REF_PIC_LIST_1, iRefIdx);
}
}
if (!pcSlice->isIntra())
{
Bool bLowDelay = true;
Int iCurrPOC = pcSlice->getPOC();
Int iRefIdx = 0;
for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_0) && bLowDelay; iRefIdx++)
{
if ( pcSlice->getRefPic(REF_PIC_LIST_0, iRefIdx)->getPOC() > iCurrPOC )
{
bLowDelay = false;
}
}
if (pcSlice->isInterB())
{
for (iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(REF_PIC_LIST_1) && bLowDelay; iRefIdx++)
{
if ( pcSlice->getRefPic(REF_PIC_LIST_1, iRefIdx)->getPOC() > iCurrPOC )
{
bLowDelay = false;
}
}
}