50 :m_frameWidthInCtus(0)
51 ,m_frameHeightInCtus(0)
55 ,m_numPartitionsInCtu(0)
56 ,m_numPartInCtuWidth(0)
57 ,m_numPartInCtuHeight(0)
60 ,m_pictureCtuArray(
NULL)
61 ,m_numTileColumnsMinus1(0)
62 ,m_numTileRowsMinus1(0)
63 ,m_ctuTsToRsAddrMap(
NULL)
64 ,m_puiTileIdxMap(
NULL)
65 ,m_ctuRsToTsAddrMap(
NULL)
67 ,m_dpbPerCtuData(
NULL)
71 ,m_pParentARLBuffer(
NULL)
82 #if REDUCED_ENCODER_MEMORY
93 #if !REDUCED_ENCODER_MEMORY
101 m_uhTotalDepth = uiMaxDepth;
102 m_numPartitionsInCtu = 1<<(m_uhTotalDepth<<1);
104 m_uiMinCUWidth = uiMaxCuWidth >> m_uhTotalDepth;
105 m_uiMinCUHeight = uiMaxCuHeight >> m_uhTotalDepth;
107 m_numPartInCtuWidth = uiMaxCuWidth / m_uiMinCUWidth;
108 m_numPartInCtuHeight = uiMaxCuHeight / m_uiMinCUHeight;
110 m_frameWidthInCtus = ( iPicWidth %uiMaxCuWidth ) ? iPicWidth /uiMaxCuWidth + 1 : iPicWidth /uiMaxCuWidth;
111 m_frameHeightInCtus = ( iPicHeight%uiMaxCuHeight ) ? iPicHeight/uiMaxCuHeight + 1 : iPicHeight/uiMaxCuHeight;
113 m_numCtusInFrame = m_frameWidthInCtus * m_frameHeightInCtus;
114 #if REDUCED_ENCODER_MEMORY
115 m_pictureCtuArray =
NULL;
117 m_pictureCtuArray =
new TComDataCU*[m_numCtusInFrame];
123 #if ADAPTIVE_QP_SELECTION
124 if (m_pParentARLBuffer ==
NULL)
130 #if REDUCED_ENCODER_MEMORY
131 if (bAllocateCtuArray)
133 prepareForReconstruction();
136 for (
UInt i=0; i<m_numCtusInFrame ; i++ )
139 m_pictureCtuArray[i]->
create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight,
false, uiMaxCuWidth >> m_uhTotalDepth
147 m_ctuTsToRsAddrMap =
new UInt[m_numCtusInFrame+1];
148 m_puiTileIdxMap =
new UInt[m_numCtusInFrame];
149 m_ctuRsToTsAddrMap =
new UInt[m_numCtusInFrame+1];
151 for(
UInt i=0; i<m_numCtusInFrame; i++ )
153 m_ctuTsToRsAddrMap[i] = i;
154 m_ctuRsToTsAddrMap[i] = i;
157 m_saoBlkParams =
new SAOBlkParam[m_numCtusInFrame];
161 xInitCtuTsRsAddrMaps();
165 #if REDUCED_ENCODER_MEMORY
246 #if REDUCED_ENCODER_MEMORY
279 #if ADAPTIVE_QP_SELECTION
326 const Int numTiles = numRows * numCols;
334 for(
Int row=0; row < numRows; row++)
336 for(
Int col=0; col < numCols; col++)
338 const Int tileIdx = row * numCols + col;
347 for(
Int row=0; row < numRows; row++)
349 Int cumulativeTileWidth = 0;
359 for(
Int col=0; col < numCols; col++)
361 Int cumulativeTileHeight = 0;
383 for(
Int row=0; row < numRows; row++)
385 for(
Int col=0; col < numCols; col++)
387 const Int tileIdx = row * numCols + col;
394 for(
Int row=0; row < numRows; row++ )
396 for(
Int col=0; col < numCols; col++ )
398 const Int tileIdx = row * numCols + col;
401 Int rightEdgePosInCTU = 0;
402 for(
Int i=0; i <= col; i++ )
404 rightEdgePosInCTU +=
m_tileParameters[row * numCols + i].getTileWidthInCtus();
409 Int bottomEdgePosInCTU = 0;
410 for(
Int i=0; i <= row; i++ )
412 bottomEdgePosInCTU +=
m_tileParameters[i * numCols + col].getTileHeightInCtus();
428 for(
Int col=0; col < numCols; col++)
436 for(
Int row=0; row < numRows; row++)
475 nextCtuRsAddr = currCtuRsAddr + 1;
479 return nextCtuRsAddr;
487 Bool& isAboveLeftAvail,
488 Bool& isAboveRightAvail,
489 Bool& isBelowLeftAvail,
490 Bool& isBelowRightAvail
498 isAboveLeftAvail = (isAboveAvail && isLeftAvail);
499 isAboveRightAvail= (isAboveAvail && isRightAvail);
500 isBelowLeftAvail = (isBelowAvail && isLeftAvail);
501 isBelowRightAvail= (isBelowAvail && isRightAvail);
538 if(ctuAboveLeft !=
NULL)
543 if(ctuBelowRight !=
NULL)
549 if(ctuAboveRight !=
NULL)
554 isAboveRightAvail = (curSliceStartTsAddr == aboveRightSliceStartTsAddr)?(
true):
561 if(ctuBelowLeft !=
NULL)
566 isBelowLeftAvail = (curSliceStartTsAddr == belowLeftSliceStartTsAddr)?(
true):
574 if(!isLoopFiltAcrossTilePPS)
591 : m_tileWidthInCtus (0)
592 , m_tileHeightInCtus (0)
593 , m_rightEdgePosInCtus (0)
594 , m_bottomEdgePosInCtus (0)
595 , m_firstCtuRsAddr (0)
612 tileXPosInCtus = firstCtuRsAddrOfTile % frameWidthInCtus;
613 tileYPosInCtus = firstCtuRsAddrOfTile / frameWidthInCtus;
Int getNumTileRowsMinus1() const
sample adaptive offset class (header)
UInt getFirstCtuRsAddr() const
UInt * m_ctuRsToTsAddrMap
for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification.
Int getNumTileColumnsMinus1() const
UInt * m_puiTileIdxMap
the map of the tile index relative to CTU raster scan address
Void setNumTileRowsMinus1(Int i)
Int getNumTileColumnsMinus1() const
slice header and SPS class (header)
Void setNumTileColumnsMinus1(Int i)
Void create(const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray)
UInt getMaxCUHeight() const
Void releaseAllReconstructionData()
std::deque< TComSlice * > m_apSlices
DPBPerCtuData * m_dpbPerCtuData
ChromaFormat getChromaFormatIdc() const
#define REDUCED_ENCODER_MEMORY
When 1, the encoder will allocate TComPic memory when required and release it when no longer required...
UInt getTileRowHeight(UInt rowIdx) const
UInt getFrameWidthInCtus() const
Int getNumTileRowsMinus1() const
Bool getTilesEnabledFlag() const
picture symbol class (header)
ProfileTierLevel * getGeneralPTL()
UInt getTileWidthInCtus() const
UInt getTileIdxMap(Int ctuRsAddr) const
TComDataCU ** m_pictureCtuArray
array of CU data.
#define ADAPTIVE_QP_SELECTION
G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection.
UInt getPicHeightInLumaSamples() const
Void xInitCtuTsRsAddrMaps()
Int TCoeff
transform coefficient
Bool getLFCrossSliceBoundaryFlag()
TCoeff * m_pParentARLBuffer
const TComPTL * getPTL() const
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
const TComPPS * getPPS() const
UInt getPicWidthInLumaSamples() const
UInt getTileColumnWidth(UInt columnIdx) const
Profile::Name getProfileIdc() const
UInt getFrameHeightInCtus() const
UInt getTileHeightInCtus() const
std::vector< TComTile > m_tileParameters
TComDataCU * getCtu(UInt ctuRsAddr)
UInt getSliceCurStartCtuTsAddr() const
UChar m_uhTotalDepth
max. depth
Void setCtuTsToRsAddrMap(Int ctuTsAddr, Int ctuRsAddr)
UInt m_numPartitionsInCtu
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
Void prepareForReconstruction()
UInt * m_ctuTsToRsAddrMap
for a given TS (Tile-Scan; coding order) address, returns the RS (Raster-Scan) address. cf CtbAddrTsToRs in specification.
Void deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, Bool &isLeftAvail, Bool &isRightAvail, Bool &isAboveAvail, Bool &isBelowAvail, Bool &isAboveLeftAvail, Bool &isAboveRightAvail, Bool &isBelowLeftAvail, Bool &isBelowRightAvail)
TComTile * getTComTile(UInt tileIdx)
SAOBlkParam * m_saoBlkParams
UInt getNumberOfCtusInFrame() const
UInt xCalculateNextCtuRSAddr(UInt uiCurrCtuRSAddr)
Bool getTileUniformSpacingFlag() const
Void setCtuRsToTsAddrMap(Int ctuRsAddr, Int ctuTsOrder)
Bool getLoopFilterAcrossTilesEnabledFlag() const
Void releaseReconstructionIntermediateData()
TComCUMvField m_CUMvField[NUM_REF_PIC_LIST_01]
Void create(UInt uiNumPartition)
Void getTilePosition(const TComDataCU *const pcCU, UInt &tileXPosInCtus, UInt &tileYPosInCtus, UInt &tileWidthtInCtus, UInt &tileHeightInCtus)
UInt getMaxCUWidth() const