本文整理汇总了C++中TComSlice::getPPS方法的典型用法代码示例。如果您正苦于以下问题:C++ TComSlice::getPPS方法的具体用法?C++ TComSlice::getPPS怎么用?C++ TComSlice::getPPS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TComSlice
的用法示例。
在下文中一共展示了TComSlice::getPPS方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: initSlice
void FrameEncoder::initSlice(TComPic* pic)
{
m_pic = pic;
TComSlice* slice = pic->getSlice();
slice->setSPS(&m_sps);
slice->setPPS(&m_pps);
slice->setSliceBits(0);
slice->setPic(pic);
slice->initSlice();
slice->setPicOutputFlag(true);
int type = pic->m_lowres.sliceType;
SliceType sliceType = IS_X265_TYPE_B(type) ? B_SLICE : ((type == X265_TYPE_P) ? P_SLICE : I_SLICE);
slice->setSliceType(sliceType);
slice->setReferenced(true);
slice->setScalingList(m_top->getScalingList());
slice->getScalingList()->setUseTransformSkip(m_pps.getUseTransformSkip());
#if LOG_CU_STATISTICS
for (int i = 0; i < m_numRows; i++)
{
m_rows[i].m_cuCoder.m_log = &m_rows[i].m_cuCoder.m_sliceTypeLog[sliceType];
}
#endif
if (slice->getPPS()->getDeblockingFilterControlPresentFlag())
{
slice->getPPS()->setDeblockingFilterOverrideEnabledFlag(!m_cfg->getLoopFilterOffsetInPPS());
slice->setDeblockingFilterOverrideFlag(!m_cfg->getLoopFilterOffsetInPPS());
slice->getPPS()->setPicDisableDeblockingFilterFlag(!m_cfg->param.bEnableLoopFilter);
slice->setDeblockingFilterDisable(!m_cfg->param.bEnableLoopFilter);
if (!slice->getDeblockingFilterDisable())
{
slice->getPPS()->setDeblockingFilterBetaOffsetDiv2(m_cfg->getLoopFilterBetaOffset());
slice->getPPS()->setDeblockingFilterTcOffsetDiv2(m_cfg->getLoopFilterTcOffset());
slice->setDeblockingFilterBetaOffsetDiv2(m_cfg->getLoopFilterBetaOffset());
slice->setDeblockingFilterTcOffsetDiv2(m_cfg->getLoopFilterTcOffset());
}
}
else
{
slice->setDeblockingFilterOverrideFlag(false);
slice->setDeblockingFilterDisable(false);
slice->setDeblockingFilterBetaOffsetDiv2(0);
slice->setDeblockingFilterTcOffsetDiv2(0);
}
slice->setMaxNumMergeCand(m_cfg->param.maxNumMergeCand);
}
示例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
Void TDecGop::decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic)
{
TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
// Table of extracted substreams.
// These must be deallocated AND their internal fifos, too.
TComInputBitstream **ppcSubstreams = NULL;
//-- For time output for each slice
long iBeforeTime = clock();
UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr();
UInt uiSliceStartCuAddr = pcSlice->getSliceCurStartCUAddr();
if(uiSliceStartCuAddr == uiStartCUAddr)
{
m_sliceStartCUAddress.push_back(uiSliceStartCuAddr);
}
m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC );
m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder);
UInt uiNumSubstreams = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams();
// init each couple {EntropyDecoder, Substream}
UInt *puiSubstreamSizes = pcSlice->getSubstreamSizes();
ppcSubstreams = new TComInputBitstream*[uiNumSubstreams];
m_pcSbacDecoders = new TDecSbac[uiNumSubstreams];
m_pcBinCABACs = new TDecBinCABAC[uiNumSubstreams];
for ( UInt ui = 0 ; ui < uiNumSubstreams ; ui++ )
{
m_pcSbacDecoders[ui].init(&m_pcBinCABACs[ui]);
ppcSubstreams[ui] = pcBitstream->extractSubstream(ui+1 < uiNumSubstreams ? puiSubstreamSizes[ui] : pcBitstream->getNumBitsLeft());
}
for ( UInt ui = 0 ; ui+1 < uiNumSubstreams; ui++ )
{
m_pcEntropyDecoder->setEntropyDecoder ( &m_pcSbacDecoders[uiNumSubstreams - 1 - ui] );
m_pcEntropyDecoder->setBitstream ( ppcSubstreams [uiNumSubstreams - 1 - ui] );
m_pcEntropyDecoder->resetEntropy (pcSlice);
}
m_pcEntropyDecoder->setEntropyDecoder ( m_pcSbacDecoder );
m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] );
m_pcEntropyDecoder->resetEntropy (pcSlice);
if(uiSliceStartCuAddr == uiStartCUAddr)
{
m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag());
}
#if H_3D_NBDV
if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
{
Int iColPoc = pcSlice->getRefPOC(RefPicList(1-pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx());
rpcPic->setNumDdvCandPics(rpcPic->getDisCandRefPictures(iColPoc));
}
if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
{
rpcPic->checkTemporalIVRef();
}
if(pcSlice->getIsDepth())
{
rpcPic->checkTextureRef();
}
#endif
#if H_3D
pcSlice->setDepthToDisparityLUTs();
#endif
m_pcSbacDecoders[0].load(m_pcSbacDecoder);
m_pcSliceDecoder->decompressSlice( ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders);
m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiNumSubstreams-1] );
// deallocate all created substreams, including internal buffers.
for (UInt ui = 0; ui < uiNumSubstreams; ui++)
{
ppcSubstreams[ui]->deleteFifo();
delete ppcSubstreams[ui];
}
delete[] ppcSubstreams;
delete[] m_pcSbacDecoders; m_pcSbacDecoders = NULL;
delete[] m_pcBinCABACs; m_pcBinCABACs = NULL;
m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;
}
示例5: decompressSlice
Void TDecGop::decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic)
{
TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
// Table of extracted substreams.
// These must be deallocated AND their internal fifos, too.
TComInputBitstream **ppcSubstreams = NULL;
//-- For time output for each slice
long iBeforeTime = clock();
UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr();
UInt uiSliceStartCuAddr = pcSlice->getSliceCurStartCUAddr();
if(uiSliceStartCuAddr == uiStartCUAddr)
{
m_sliceStartCUAddress.push_back(uiSliceStartCuAddr);
}
m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC );
m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder);
UInt uiNumSubstreams = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams();
// init each couple {EntropyDecoder, Substream}
UInt *puiSubstreamSizes = pcSlice->getSubstreamSizes();
ppcSubstreams = new TComInputBitstream*[uiNumSubstreams];
m_pcSbacDecoders = new TDecSbac[uiNumSubstreams];
m_pcBinCABACs = new TDecBinCABAC[uiNumSubstreams];
for ( UInt ui = 0 ; ui < uiNumSubstreams ; ui++ )
{
m_pcSbacDecoders[ui].init(&m_pcBinCABACs[ui]);
ppcSubstreams[ui] = pcBitstream->extractSubstream(ui+1 < uiNumSubstreams ? puiSubstreamSizes[ui] : pcBitstream->getNumBitsLeft());
}
for ( UInt ui = 0 ; ui+1 < uiNumSubstreams; ui++ )
{
m_pcEntropyDecoder->setEntropyDecoder ( &m_pcSbacDecoders[uiNumSubstreams - 1 - ui] );
m_pcEntropyDecoder->setBitstream ( ppcSubstreams [uiNumSubstreams - 1 - ui] );
m_pcEntropyDecoder->resetEntropy (pcSlice);
}
m_pcEntropyDecoder->setEntropyDecoder ( m_pcSbacDecoder );
m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] );
m_pcEntropyDecoder->resetEntropy (pcSlice);
if(uiSliceStartCuAddr == uiStartCUAddr)
{
m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag());
}
m_pcSbacDecoders[0].load(m_pcSbacDecoder);
m_pcSliceDecoder->decompressSlice( ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders);
m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiNumSubstreams-1] );
// deallocate all created substreams, including internal buffers.
for (UInt ui = 0; ui < uiNumSubstreams; ui++)
{
ppcSubstreams[ui]->deleteFifo();
delete ppcSubstreams[ui];
}
delete[] ppcSubstreams;
delete[] m_pcSbacDecoders; m_pcSbacDecoders = NULL;
delete[] m_pcBinCABACs; m_pcBinCABACs = NULL;
m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;
}
示例6: 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);
}
}
}
}
示例7: decompressSlice
Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic* pcPic, TDecSbac* pcSbacDecoder)
{
TComSlice* pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx());
const Int startCtuTsAddr = pcSlice->getSliceSegmentCurStartCtuTsAddr();
const Int startCtuRsAddr = pcPic->getPicSym()->getCtuTsToRsAddrMap(startCtuTsAddr);
const UInt numCtusInFrame = pcPic->getNumberOfCtusInFrame();
const UInt frameWidthInCtus = pcPic->getPicSym()->getFrameWidthInCtus();
const Bool depSliceSegmentsEnabled = pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag();
const Bool wavefrontsEnabled = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag();
m_pcEntropyDecoder->setEntropyDecoder ( pcSbacDecoder );
m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] );
m_pcEntropyDecoder->resetEntropy (pcSlice);
// decoder doesn't need prediction & residual frame buffer
pcPic->setPicYuvPred( 0 );
pcPic->setPicYuvResi( 0 );
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceEnable;
#endif
DTRACE_CABAC_VL( g_nSymbolCounter++ );
DTRACE_CABAC_T( "\tPOC: " );
DTRACE_CABAC_V( pcPic->getPOC() );
DTRACE_CABAC_T( "\n" );
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceDisable;
#endif
// The first CTU of the slice is the first coded substream, but the global substream number, as calculated by getSubstreamForCtuAddr may be higher.
// This calculates the common offset for all substreams in this slice.
const UInt subStreamOffset=pcPic->getSubstreamForCtuAddr(startCtuRsAddr, true, pcSlice);
if (depSliceSegmentsEnabled)
{
// modify initial contexts with previous slice segment if this is a dependent slice.
const UInt startTileIdx=pcPic->getPicSym()->getTileIdxMap(startCtuRsAddr);
const TComTile *pCurrentTile=pcPic->getPicSym()->getTComTile(startTileIdx);
const UInt firstCtuRsAddrOfTile = pCurrentTile->getFirstCtuRsAddr();
if( pcSlice->getDependentSliceSegmentFlag() && startCtuRsAddr != firstCtuRsAddrOfTile)
{
if ( pCurrentTile->getTileWidthInCtus() >= 2 || !wavefrontsEnabled)
{
pcSbacDecoder->loadContexts(&m_lastSliceSegmentEndContextState);
}
}
}
// for every CTU in the slice segment...
Bool isLastCtuOfSliceSegment = false;
for( UInt ctuTsAddr = startCtuTsAddr; !isLastCtuOfSliceSegment && ctuTsAddr < numCtusInFrame; ctuTsAddr++)
{
const UInt ctuRsAddr = pcPic->getPicSym()->getCtuTsToRsAddrMap(ctuTsAddr);
const TComTile ¤tTile = *(pcPic->getPicSym()->getTComTile(pcPic->getPicSym()->getTileIdxMap(ctuRsAddr)));
const UInt firstCtuRsAddrOfTile = currentTile.getFirstCtuRsAddr();
const UInt tileXPosInCtus = firstCtuRsAddrOfTile % frameWidthInCtus;
const UInt tileYPosInCtus = firstCtuRsAddrOfTile / frameWidthInCtus;
const UInt ctuXPosInCtus = ctuRsAddr % frameWidthInCtus;
const UInt ctuYPosInCtus = ctuRsAddr / frameWidthInCtus;
const UInt uiSubStrm=pcPic->getSubstreamForCtuAddr(ctuRsAddr, true, pcSlice)-subStreamOffset;
TComDataCU* pCtu = pcPic->getCtu( ctuRsAddr );
pCtu->initCtu( pcPic, ctuRsAddr );
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;
//.........这里部分代码省略.........
示例8: decompressSlice
Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
{
TComDataCU* pcCU;
UInt uiIsLast = 0;
Int iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr()/rpcPic->getNumPartInCU());
Int iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder);
// decoder don't need prediction & residual frame buffer
#if ENABLE_ANAYSIS_OUTPUT
#else
rpcPic->setPicYuvPred( 0 );
rpcPic->setPicYuvResi( 0 );
#endif
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceEnable;
#endif
DTRACE_CABAC_VL( g_nSymbolCounter++ );
DTRACE_CABAC_T( "\tPOC: " );
DTRACE_CABAC_V( rpcPic->getPOC() );
DTRACE_CABAC_T( "\n" );
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceDisable;
#endif
UInt uiTilesAcross = rpcPic->getPicSym()->getNumColumnsMinus1()+1;
TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
Int iNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
// delete decoders if already allocated in previous slice
if (m_pcBufferSbacDecoders)
{
delete [] m_pcBufferSbacDecoders;
}
if (m_pcBufferBinCABACs)
{
delete [] m_pcBufferBinCABACs;
}
// allocate new decoders based on tile numbaer
m_pcBufferSbacDecoders = new TDecSbac [uiTilesAcross];
m_pcBufferBinCABACs = new TDecBinCABAC[uiTilesAcross];
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferSbacDecoders[ui].init(&m_pcBufferBinCABACs[ui]);
}
//save init. state
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferSbacDecoders[ui].load(pcSbacDecoder);
}
// free memory if already allocated in previous call
if (m_pcBufferLowLatSbacDecoders)
{
delete [] m_pcBufferLowLatSbacDecoders;
}
if (m_pcBufferLowLatBinCABACs)
{
delete [] m_pcBufferLowLatBinCABACs;
}
m_pcBufferLowLatSbacDecoders = new TDecSbac [uiTilesAcross];
m_pcBufferLowLatBinCABACs = new TDecBinCABAC[uiTilesAcross];
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferLowLatSbacDecoders[ui].init(&m_pcBufferLowLatBinCABACs[ui]);
}
//save init. state
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferLowLatSbacDecoders[ui].load(pcSbacDecoder);
}
UInt uiWidthInLCUs = rpcPic->getPicSym()->getFrameWidthInCU();
//UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU();
UInt uiCol=0, uiLin=0, uiSubStrm=0;
UInt uiTileCol;
UInt uiTileStartLCU;
UInt uiTileLCUX;
Int iNumSubstreamsPerTile = 1; // if independent.
Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag();
uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr();
if( depSliceSegmentsEnabled )
{
if( (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice()) &&
iStartCUAddr != rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr())
{
if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
{
uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1);
m_pcBufferSbacDecoders[uiTileCol].loadContexts( CTXMem[1] );//2.LCU
if ( (iStartCUAddr%uiWidthInLCUs+1) >= uiWidthInLCUs )
{
uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
uiCol = iStartCUAddr % uiWidthInLCUs;
if(uiCol==uiTileLCUX)
{
//.........这里部分代码省略.........
示例9: decompressSlice
Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
{
TComDataCU* pcCU;
UInt uiIsLast = 0;
Int iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getEntropySliceCurStartCUAddr()/rpcPic->getNumPartInCU());
Int iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder);
// decoder don't need prediction & residual frame buffer
rpcPic->setPicYuvPred( 0 );
rpcPic->setPicYuvResi( 0 );
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceEnable;
#endif
DTRACE_CABAC_VL( g_nSymbolCounter++ );
DTRACE_CABAC_T( "\tPOC: " );
DTRACE_CABAC_V( rpcPic->getPOC() );
DTRACE_CABAC_T( "\n" );
#if ENC_DEC_TRACE
g_bJustDoIt = g_bEncDecTraceDisable;
#endif
UInt uiTilesAcross = rpcPic->getPicSym()->getNumColumnsMinus1()+1;
TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
UInt iSymbolMode = pcSlice->getPPS()->getEntropyCodingMode();
Int iNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
if( iSymbolMode )
{
m_pcBufferSbacDecoders = new TDecSbac [uiTilesAcross];
m_pcBufferBinCABACs = new TDecBinCABAC[uiTilesAcross];
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferSbacDecoders[ui].init(&m_pcBufferBinCABACs[ui]);
}
//save init. state
for (UInt ui = 0; ui < uiTilesAcross; ui++)
{
m_pcBufferSbacDecoders[ui].load(pcSbacDecoder);
}
}
if( iSymbolMode )
{
m_pcBufferLowLatSbacDecoders = new TDecSbac [uiTilesAcross];
m_pcBufferLowLatBinCABACs = new TDecBinCABAC[uiTilesAcross];
for (UInt ui = 0; ui < uiTilesAcross; ui++)
m_pcBufferLowLatSbacDecoders[ui].init(&m_pcBufferLowLatBinCABACs[ui]);
//save init. state
for (UInt ui = 0; ui < uiTilesAcross; ui++)
m_pcBufferLowLatSbacDecoders[ui].load(pcSbacDecoder);
}
UInt uiWidthInLCUs = rpcPic->getPicSym()->getFrameWidthInCU();
//UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU();
UInt uiCol=0, uiLin=0, uiSubStrm=0;
UInt uiTileCol;
UInt uiTileStartLCU;
UInt uiTileLCUX;
UInt uiTileLCUY;
UInt uiTileWidth;
UInt uiTileHeight;
Int iNumSubstreamsPerTile = 1; // if independent.
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;
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;
//.........这里部分代码省略.........
示例10: 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;
//.........这里部分代码省略.........
示例11: 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()) )
//.........这里部分代码省略.........
示例12: 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()) )
{
//.........这里部分代码省略.........