本文整理汇总了C++中TComSlice::getSPS方法的典型用法代码示例。如果您正苦于以下问题:C++ TComSlice::getSPS方法的具体用法?C++ TComSlice::getSPS怎么用?C++ TComSlice::getSPS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TComSlice
的用法示例。
在下文中一共展示了TComSlice::getSPS方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareEncode
void DPB::prepareEncode(TComPic *pic)
{
PPAScopeEvent(DPB_prepareEncode);
int pocCurr = pic->getSlice()->getPOC();
m_picList.pushFront(*pic);
TComSlice* slice = pic->getSlice();
if (getNalUnitType(pocCurr, m_lastIDR, pic) == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
getNalUnitType(pocCurr, m_lastIDR, pic) == NAL_UNIT_CODED_SLICE_IDR_N_LP)
{
m_lastIDR = pocCurr;
}
slice->setLastIDR(m_lastIDR);
slice->setTemporalLayerNonReferenceFlag(!slice->isReferenced());
// Set the nal unit type
slice->setNalUnitType(getNalUnitType(pocCurr, m_lastIDR, pic));
// If the slice is un-referenced, change from _R "referenced" to _N "non-referenced" NAL unit type
if (slice->getTemporalLayerNonReferenceFlag())
{
switch (slice->getNalUnitType())
{
case NAL_UNIT_CODED_SLICE_TRAIL_R:
slice->setNalUnitType(NAL_UNIT_CODED_SLICE_TRAIL_N);
break;
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;
//.........这里部分代码省略.........
示例2: decompressSlice
//.........这里部分代码省略.........
m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
// set up CABAC contexts' state for this CTU
if (ctuRsAddr == firstCtuRsAddrOfTile)
{
if (ctuTsAddr != startCtuTsAddr) // if it is the first CTU, then the entropy coder has already been reset
{
m_pcEntropyDecoder->resetEntropy(pcSlice);
}
}
else if (ctuXPosInCtus == tileXPosInCtus && wavefrontsEnabled)
{
// Synchronize cabac probabilities with upper-right CTU if it's available and at the start of a line.
if (ctuTsAddr != startCtuTsAddr) // if it is the first CTU, then the entropy coder has already been reset
{
m_pcEntropyDecoder->resetEntropy(pcSlice);
}
TComDataCU *pCtuUp = pCtu->getCtuAbove();
if ( pCtuUp && ((ctuRsAddr%frameWidthInCtus+1) < frameWidthInCtus) )
{
TComDataCU *pCtuTR = pcPic->getCtu( ctuRsAddr - frameWidthInCtus + 1 );
if ( pCtu->CUIsFromSameSliceAndTile(pCtuTR) )
{
// Top-right is available, so use it.
pcSbacDecoder->loadContexts( &m_entropyCodingSyncContextState );
}
}
}
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceEnable;
#endif
if ( pcSlice->getSPS()->getUseSAO() )
{
SAOBlkParam& saoblkParam = (pcPic->getPicSym()->getSAOBlkParam())[ctuRsAddr];
Bool bIsSAOSliceEnabled = false;
Bool sliceEnabled[MAX_NUM_COMPONENT];
for(Int comp=0; comp < MAX_NUM_COMPONENT; comp++)
{
ComponentID compId=ComponentID(comp);
sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents());
if (sliceEnabled[compId]) bIsSAOSliceEnabled=true;
saoblkParam[compId].modeIdc = SAO_MODE_OFF;
}
if (bIsSAOSliceEnabled)
{
Bool leftMergeAvail = false;
Bool aboveMergeAvail= false;
//merge left condition
Int rx = (ctuRsAddr % frameWidthInCtus);
if(rx > 0)
{
leftMergeAvail = pcPic->getSAOMergeAvailability(ctuRsAddr, ctuRsAddr-1);
}
//merge up condition
Int ry = (ctuRsAddr / frameWidthInCtus);
if(ry > 0)
{
aboveMergeAvail = pcPic->getSAOMergeAvailability(ctuRsAddr, ctuRsAddr-frameWidthInCtus);
}
#if SVC_EXTENSION
pcSbacDecoder->parseSAOBlkParam( saoblkParam, m_saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail);
#else
pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail);
示例3: filterPicture
Void TDecGop::filterPicture(TComPic*& rpcPic)
{
TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
//-- For time output for each slice
long iBeforeTime = clock();
// deblocking filter
Bool bLFCrossTileBoundary = pcSlice->getPPS()->getLoopFilterAcrossTilesEnabledFlag();
m_pcLoopFilter->setCfg(bLFCrossTileBoundary);
m_pcLoopFilter->loopFilterPic( rpcPic );
if(pcSlice->getSPS()->getUseSAO())
{
m_sliceStartCUAddress.push_back(rpcPic->getNumCUsInFrame()* rpcPic->getNumPartInCU());
rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary);
}
if( pcSlice->getSPS()->getUseSAO() )
{
{
SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
m_pcSAO->setSaoLcuBasedOptimization(1);
m_pcSAO->createPicSaoInfo(rpcPic);
m_pcSAO->SAOProcess(saoParam);
m_pcSAO->PCMLFDisableProcess(rpcPic);
m_pcSAO->destroyPicSaoInfo();
}
}
if(pcSlice->getSPS()->getUseSAO())
{
rpcPic->destroyNonDBFilterInfo();
}
#if H_3D
rpcPic->compressMotion(2);
#endif
#if !H_3D
rpcPic->compressMotion();
#endif
Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
if (!pcSlice->isReferenced()) c += 32;
//-- For time output for each slice
#if H_MV
printf("\nLayer %2d POC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getLayerId(),
pcSlice->getPOC(),
pcSlice->getTLayer(),
c,
pcSlice->getSliceQp() );
#else
printf("\nPOC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
pcSlice->getTLayer(),
c,
pcSlice->getSliceQp() );
#endif
m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;
printf ("[DT %6.3f] ", m_dDecTime );
m_dDecTime = 0;
for (Int iRefList = 0; iRefList < 2; iRefList++)
{
printf ("[L%d ", iRefList);
for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++)
{
#if H_MV
if( pcSlice->getLayerId() != pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) )
{
printf( "V%d ", pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) );
}
else
{
#endif
printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex));
#if H_MV
}
#endif
}
printf ("] ");
}
if (m_decodedPictureHashSEIEnabled)
{
SEIMessages pictureHashes = getSeisByType(rpcPic->getSEIs(), SEI::DECODED_PICTURE_HASH );
const SEIDecodedPictureHash *hash = ( pictureHashes.size() > 0 ) ? (SEIDecodedPictureHash*) *(pictureHashes.begin()) : NULL;
if (pictureHashes.size() > 1)
{
printf ("Warning: Got multiple decoded picture hash SEI messages. Using first.");
}
calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), hash);
}
rpcPic->setOutputMark(true);
rpcPic->setReconMark(true);
m_sliceStartCUAddress.clear();
m_LFCrossSliceBoundaryFlag.clear();
}
示例4: decompressSlice
//.........这里部分代码省略.........
}
CTXMem[0]->loadContexts(pcSbacDecoder);
}
}
for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) )
{
pcCU = rpcPic->getCU( iCUAddr );
pcCU->initCU( rpcPic, iCUAddr );
uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in?
uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr();
uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
uiCol = iCUAddr % uiWidthInLCUs;
// The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture.
uiLin = (iCUAddr/uiWidthInLCUs)-(iStartCUAddr/uiWidthInLCUs);
// inherit from TR if necessary, select substream to use.
if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( depSliceSegmentsEnabled && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ))
{
// independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied.
iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles();
uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile
+ uiLin%iNumSubstreamsPerTile;
m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
// Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.
if (((pcSlice->getPPS()->getNumSubstreams() > 1) || depSliceSegmentsEnabled ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()))
{
// We'll sync if the TR is available.
TComDataCU *pcCUUp = pcCU->getCUAbove();
UInt uiWidthInCU = rpcPic->getFrameWidthInCU();
TComDataCU *pcCUTR = NULL;
if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU) )
{
pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 );
}
UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);
if ( (true/*bEnforceSliceRestriction*/ &&
((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) ||
((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
))
)
{
// TR not available.
}
else
{
// TR is available, we use it.
pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );
}
}
pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
}
else if ( pcSlice->getPPS()->getNumSubstreams() <= 1 )
{
// Set variables to appropriate values to avoid later code change.
iNumSubstreamsPerTile = 1;
}
if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile.
(iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())
&& (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr())/rpcPic->getNumPartInCU())
) // !1st in frame && !1st in slice
{
if (pcSlice->getPPS()->getNumSubstreams() > 1)
{
// We're crossing into another tile, tiles are independent.
示例5: decompressSlice
//.........这里部分代码省略.........
uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
uiTileLCUY = uiTileStartLCU / uiWidthInLCUs;
uiTileWidth = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileWidth();
uiTileHeight = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileHeight();
uiCol = iCUAddr % uiWidthInLCUs;
uiLin = iCUAddr / uiWidthInLCUs;
// inherit from TR if necessary, select substream to use.
if( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() > 1 )
{
if (pcSlice->getPPS()->getNumSubstreams() > 1)
{
// independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied.
iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles();
uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile
+ uiLin%iNumSubstreamsPerTile;
}
else
{
// dependent tiles => substreams are "per frame".
uiSubStrm = uiLin % iNumSubstreams;
}
m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
// Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.
if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX)
{
// We'll sync if the TR is available.
TComDataCU *pcCUUp = pcCU->getCUAbove();
UInt uiWidthInCU = rpcPic->getFrameWidthInCU();
TComDataCU *pcCUTR = NULL;
if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU) )
{
pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 );
}
UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);
if ( (true/*bEnforceSliceRestriction*/ &&
((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) ||
((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
))||
(true/*bEnforceEntropySliceRestriction*/ &&
((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) ||
((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
))
)
{
// TR not available.
}
else
{
// TR is available, we use it.
pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );
}
}
pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
}
else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 )
{
// Set variables to appropriate values to avoid later code change.
iNumSubstreamsPerTile = 1;
}
if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile.
(iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice
{
示例6: xDecodeSlice
Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
{
m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice
// it is not associated with picture, sps or pps structures.
if (m_bFirstSliceInPicture)
{
m_uiSliceIdx = 0;
}
else
{
m_apcSlicePilot->copySliceInfo( m_pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) );
}
m_apcSlicePilot->setSliceIdx(m_uiSliceIdx);
m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N);
m_apcSlicePilot->setTemporalLayerNonReferenceFlag(nonReferenceFlag);
m_apcSlicePilot->setReferenced(true); // Putting this as true ensures that picture is referenced the first time it is in an RPS
m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId);
#if ENC_DEC_TRACE
const UInt64 originalSymbolCount = g_nSymbolCounter;
#endif
m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager);
// set POC for dependent slices in skipped pictures
if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
{
m_apcSlicePilot->setPOC(m_skippedPOC);
}
m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA);
m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType);
//For inference of NoOutputOfPriorPicsFlag
if (m_apcSlicePilot->getRapPicFlag())
{
if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
{
m_apcSlicePilot->setNoRaslOutputFlag(true);
}
//the inference for NoOutputPriorPicsFlag
if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag())
{
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
{
m_apcSlicePilot->setNoOutputPriorPicsFlag(true);
}
}
else
{
m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
}
if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
{
m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag();
}
}
if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag())
{
m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC();
m_isNoOutputPriorPics = true;
}
else
{
m_isNoOutputPriorPics = false;
}
//For inference of PicOutputFlag
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
{
if ( m_craNoRaslOutputFlag )
{
m_apcSlicePilot->setPicOutputFlag(false);
}
}
if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
{
TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId());
assert (pps != 0);
TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId());
assert (sps != 0);
Int iMaxPOClsb = 1 << sps->getBitsForPOC();
m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
}
// Skip pictures due to random access
if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
{
m_prevSliceSkipped = true;
//.........这里部分代码省略.........
示例7: xActivateParameterSets
Void TDecTop::xActivateParameterSets()
{
if (m_bFirstSliceInPicture)
{
const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value
assert (pps != 0);
const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value
assert (sps != 0);
m_parameterSetManager.clearSPSChangedFlag(sps->getSPSId());
m_parameterSetManager.clearPPSChangedFlag(pps->getPPSId());
if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
{
printf ("Parameter set activation failed!");
assert (0);
}
// TODO: remove the use of the following globals:
for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++)
{
g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel));
g_maxTrDynamicRange[channel] = (sps->getUseExtendedPrecision()) ? std::max<Int>(15, (g_bitDepth[channel] + 6)) : 15;
}
g_uiMaxCUWidth = sps->getMaxCUWidth();
g_uiMaxCUHeight = sps->getMaxCUHeight();
g_uiMaxCUDepth = sps->getMaxCUDepth();
g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize()));
// Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use.
xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer());
m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
// make the slice-pilot a real slice, and set up the slice-pilot for the next slice
assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
// we now have a real slice:
TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx);
// Update the PPS and SPS pointers with the ones of the picture.
pps=pSlice->getPPS();
sps=pSlice->getSPS();
// Initialise the various objects for the new set of settings
m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
m_cLoopFilter.create( sps->getMaxCUDepth() );
m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
Bool isField = false;
Bool isTopField = false;
if(!m_SEIs.empty())
{
// Check if any new Picture Timing SEI has arrived
SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING);
if (pictureTimingSEIs.size()>0)
{
SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12);
isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11);
}
}
//Set Field/Frame coding mode
m_pcPic->setField(isField);
m_pcPic->setTopField(isTopField);
// transfer any SEI messages that have been received to the picture
m_pcPic->setSEIs(m_SEIs);
m_SEIs.clear();
// Recursive structure
m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
m_cTrQuant.init ( sps->getMaxTrSize() );
m_cSliceDecoder.create();
}
else
{
// make the slice-pilot a real slice, and set up the slice-pilot for the next slice
m_pcPic->allocateNewSlice();
assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); // we now have a real slice.
const TComSPS *sps = pSlice->getSPS();
const TComPPS *pps = pSlice->getPPS();
// check that the current active PPS has not changed...
if (m_parameterSetManager.getSPSChangedFlag(sps->getSPSId()) )
{
printf("Error - a new SPS has been decoded while processing a picture\n");
exit(1);
}
if (m_parameterSetManager.getPPSChangedFlag(pps->getPPSId()) )
//.........这里部分代码省略.........
示例8: xActivateParameterSets
Void TDecTop::xActivateParameterSets()
{
if (m_bFirstSliceInPicture)
{
const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value
assert (pps != 0);
const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value
assert (sps != 0);
m_parameterSetManager.clearSPSChangedFlag(sps->getSPSId());
m_parameterSetManager.clearPPSChangedFlag(pps->getPPSId());
if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
{
printf ("Parameter set activation failed!");
assert (0);
}
xParsePrefixSEImessages();
#if RExt__HIGH_BIT_DEPTH_SUPPORT==0
if (sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag() || sps->getBitDepth(CHANNEL_TYPE_LUMA)>12 || sps->getBitDepth(CHANNEL_TYPE_CHROMA)>12 )
{
printf("High bit depth support must be enabled at compile-time in order to decode this bitstream\n");
assert (0);
exit(1);
}
#endif
// NOTE: globals were set up here originally. You can now use:
// g_uiMaxCUDepth = sps->getMaxTotalCUDepth();
// g_uiAddCUDepth = sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()
// Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use.
xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer());
m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
// make the slice-pilot a real slice, and set up the slice-pilot for the next slice
assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
// we now have a real slice:
TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx);
// Update the PPS and SPS pointers with the ones of the picture.
pps=pSlice->getPPS();
sps=pSlice->getSPS();
// Initialise the various objects for the new set of settings
m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
Bool isField = false;
Bool isTopField = false;
if(!m_SEIs.empty())
{
// Check if any new Picture Timing SEI has arrived
SEIMessages pictureTimingSEIs = getSeisByType(m_SEIs, SEI::PICTURE_TIMING);
if (pictureTimingSEIs.size()>0)
{
SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12);
isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11);
}
}
//Set Field/Frame coding mode
m_pcPic->setField(isField);
m_pcPic->setTopField(isTopField);
// transfer any SEI messages that have been received to the picture
m_pcPic->setSEIs(m_SEIs);
m_SEIs.clear();
// Recursive structure
m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
m_cTrQuant.init ( sps->getMaxTrSize() );
m_cSliceDecoder.create();
}
else
{
// make the slice-pilot a real slice, and set up the slice-pilot for the next slice
m_pcPic->allocateNewSlice();
assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); // we now have a real slice.
const TComSPS *sps = pSlice->getSPS();
const TComPPS *pps = pSlice->getPPS();
// check that the current active PPS has not changed...
if (m_parameterSetManager.getSPSChangedFlag(sps->getSPSId()) )
{
//.........这里部分代码省略.........