本文整理汇总了C++中TComSlice::getSliceCurStartCUAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ TComSlice::getSliceCurStartCUAddr方法的具体用法?C++ TComSlice::getSliceCurStartCUAddr怎么用?C++ TComSlice::getSliceCurStartCUAddr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TComSlice
的用法示例。
在下文中一共展示了TComSlice::getSliceCurStartCUAddr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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)
{
//.........这里部分代码省略.........
示例3: 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;
}
示例4: 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;
//.........这里部分代码省略.........