HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TComPicSym.cpp
Go to the documentation of this file.
1 /* The copyright in this software is being made available under the BSD
2  * License, included below. This software may be subject to other third party
3  * and contributor rights, including patent rights, and no such rights are
4  * granted under this license.
5  *
6  * Copyright (c) 2010-2017, ITU/ISO/IEC
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18  * be used to endorse or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31  * THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
38 #include "TComPicSym.h"
40 #include "TComSlice.h"
41 
44 
45 // ====================================================================================================================
46 // Constructor / destructor / create / destroy
47 // ====================================================================================================================
48 
50 :m_frameWidthInCtus(0)
51 ,m_frameHeightInCtus(0)
52 ,m_uiMinCUWidth(0)
53 ,m_uiMinCUHeight(0)
54 ,m_uhTotalDepth(0)
55 ,m_numPartitionsInCtu(0)
56 ,m_numPartInCtuWidth(0)
57 ,m_numPartInCtuHeight(0)
58 ,m_numCtusInFrame(0)
59 ,m_apSlices()
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)
68 #endif
69 ,m_saoBlkParams(NULL)
71 ,m_pParentARLBuffer(NULL)
72 #endif
73 {}
74 
75 
77 {
78  destroy();
79 }
80 
81 
82 #if REDUCED_ENCODER_MEMORY
83 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray )
84 #else
85 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth )
86 #endif
87 {
88  destroy();
89 
90  m_sps = sps;
91  m_pps = pps;
92 
93 #if !REDUCED_ENCODER_MEMORY
94  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
95 #endif
96  const Int iPicWidth = sps.getPicWidthInLumaSamples();
97  const Int iPicHeight = sps.getPicHeightInLumaSamples();
98  const UInt uiMaxCuWidth = sps.getMaxCUWidth();
99  const UInt uiMaxCuHeight = sps.getMaxCUHeight();
100 
101  m_uhTotalDepth = uiMaxDepth;
102  m_numPartitionsInCtu = 1<<(m_uhTotalDepth<<1);
103 
104  m_uiMinCUWidth = uiMaxCuWidth >> m_uhTotalDepth;
105  m_uiMinCUHeight = uiMaxCuHeight >> m_uhTotalDepth;
106 
107  m_numPartInCtuWidth = uiMaxCuWidth / m_uiMinCUWidth; // equivalent to 1<<m_uhTotalDepth
108  m_numPartInCtuHeight = uiMaxCuHeight / m_uiMinCUHeight; // equivalent to 1<<m_uhTotalDepth
109 
110  m_frameWidthInCtus = ( iPicWidth %uiMaxCuWidth ) ? iPicWidth /uiMaxCuWidth + 1 : iPicWidth /uiMaxCuWidth;
111  m_frameHeightInCtus = ( iPicHeight%uiMaxCuHeight ) ? iPicHeight/uiMaxCuHeight + 1 : iPicHeight/uiMaxCuHeight;
112 
113  m_numCtusInFrame = m_frameWidthInCtus * m_frameHeightInCtus;
114 #if REDUCED_ENCODER_MEMORY
115  m_pictureCtuArray = NULL;
116 #else
117  m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame];
118 #endif
119 
120  clearSliceBuffer();
121  allocateNewSlice();
122 
123 #if ADAPTIVE_QP_SELECTION
124  if (m_pParentARLBuffer == NULL)
125  {
126  m_pParentARLBuffer = new TCoeff[uiMaxCuWidth*uiMaxCuHeight*MAX_NUM_COMPONENT];
127  }
128 #endif
129 
130 #if REDUCED_ENCODER_MEMORY
131  if (bAllocateCtuArray)
132  {
133  prepareForReconstruction();
134  }
135 #else
136  for (UInt i=0; i<m_numCtusInFrame ; i++ )
137  {
138  m_pictureCtuArray[i] = new TComDataCU;
139  m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight, false, uiMaxCuWidth >> m_uhTotalDepth
141  , m_pParentARLBuffer
142 #endif
143  );
144  }
145 #endif
146 
147  m_ctuTsToRsAddrMap = new UInt[m_numCtusInFrame+1];
148  m_puiTileIdxMap = new UInt[m_numCtusInFrame];
149  m_ctuRsToTsAddrMap = new UInt[m_numCtusInFrame+1];
150 
151  for(UInt i=0; i<m_numCtusInFrame; i++ )
152  {
153  m_ctuTsToRsAddrMap[i] = i;
154  m_ctuRsToTsAddrMap[i] = i;
155  }
156 
157  m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame];
158 
159 
160  xInitTiles();
161  xInitCtuTsRsAddrMaps();
162 
163 }
164 
165 #if REDUCED_ENCODER_MEMORY
167 {
168  const ChromaFormat chromaFormatIDC = m_sps.getChromaFormatIdc();
169  const UInt uiMaxCuWidth = m_sps.getMaxCUWidth();
170  const UInt uiMaxCuHeight = m_sps.getMaxCUHeight();
171  if (m_pictureCtuArray == NULL)
172  {
174 
175  for (UInt i=0; i<m_numCtusInFrame ; i++ )
176  {
177  m_pictureCtuArray[i] = new TComDataCU;
178  m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight, false, uiMaxCuWidth >> m_uhTotalDepth
181 #endif
182  );
183  }
184  }
185  if (m_dpbPerCtuData == NULL)
186  {
188  for(UInt i=0; i<m_numCtusInFrame; i++)
189  {
190  for(Int j=0; j<NUM_REF_PIC_LIST_01; j++)
191  {
193  }
199  }
200  }
201 }
202 
204 {
205  if (m_pictureCtuArray)
206  {
207  for (Int i = 0; i < m_numCtusInFrame; i++)
208  {
209  if (m_pictureCtuArray[i])
210  {
212  delete m_pictureCtuArray[i];
213  m_pictureCtuArray[i] = NULL;
214  }
215  }
216  delete [] m_pictureCtuArray;
218  }
219 }
220 
222 {
224 
225  if (m_dpbPerCtuData != NULL)
226  {
227  for(UInt i=0; i<m_numCtusInFrame; i++)
228  {
229  for(Int j=0; j<NUM_REF_PIC_LIST_01; j++)
230  {
232  }
233  delete [] m_dpbPerCtuData[i].m_pePredMode;
234  delete [] m_dpbPerCtuData[i].m_pePartSize;
235  }
236  delete [] m_dpbPerCtuData;
238  }
239 }
240 #endif
241 
243 {
245 
246 #if REDUCED_ENCODER_MEMORY
248 #else
249  if (m_pictureCtuArray)
250  {
251  for (Int i = 0; i < m_numCtusInFrame; i++)
252  {
253  if (m_pictureCtuArray[i])
254  {
256  delete m_pictureCtuArray[i];
257  m_pictureCtuArray[i] = NULL;
258  }
259  }
260  delete [] m_pictureCtuArray;
262  }
263 #endif
264 
265  delete [] m_ctuTsToRsAddrMap;
267 
268  delete [] m_puiTileIdxMap;
270 
271  delete [] m_ctuRsToTsAddrMap;
273 
274  if(m_saoBlkParams)
275  {
276  delete[] m_saoBlkParams; m_saoBlkParams = NULL;
277  }
278 
279 #if ADAPTIVE_QP_SELECTION
280  delete [] m_pParentARLBuffer;
282 #endif
283 }
284 
286 {
287  m_apSlices.push_back(new TComSlice);
288  m_apSlices.back()->setPPS(&m_pps);
289  m_apSlices.back()->setSPS(&m_sps);
290  if (m_apSlices.size()>=2)
291  {
292  m_apSlices.back()->copySliceInfo( m_apSlices[m_apSlices.size()-2] );
293  m_apSlices.back()->initSlice();
294  }
295 }
296 
298 {
299  for (UInt i = 0; i < UInt(m_apSlices.size()); i++)
300  {
301  delete m_apSlices[i];
302  }
303  m_apSlices.clear();
304 }
305 
307 {
308  //generate the Coding Order Map and Inverse Coding Order Map
309  for(Int ctuTsAddr=0, ctuRsAddr=0; ctuTsAddr<getNumberOfCtusInFrame(); ctuTsAddr++, ctuRsAddr = xCalculateNextCtuRSAddr(ctuRsAddr))
310  {
311  setCtuTsToRsAddrMap(ctuTsAddr, ctuRsAddr);
312  setCtuRsToTsAddrMap(ctuRsAddr, ctuTsAddr);
313  }
316 }
317 
319 {
320  //set NumColumnsMinus1 and NumRowsMinus1
323 
324  const Int numCols = m_pps.getNumTileColumnsMinus1() + 1;
325  const Int numRows = m_pps.getNumTileRowsMinus1() + 1;
326  const Int numTiles = numRows * numCols;
327 
328  // allocate memory for tile parameters
329  m_tileParameters.resize(numTiles);
330 
332  {
333  //set width and height for each (uniform) tile
334  for(Int row=0; row < numRows; row++)
335  {
336  for(Int col=0; col < numCols; col++)
337  {
338  const Int tileIdx = row * numCols + col;
339  m_tileParameters[tileIdx].setTileWidthInCtus( (col+1)*getFrameWidthInCtus( )/numCols - (col*getFrameWidthInCtus( ))/numCols );
340  m_tileParameters[tileIdx].setTileHeightInCtus( (row+1)*getFrameHeightInCtus()/numRows - (row*getFrameHeightInCtus())/numRows );
341  }
342  }
343  }
344  else
345  {
346  //set the width for each tile
347  for(Int row=0; row < numRows; row++)
348  {
349  Int cumulativeTileWidth = 0;
350  for(Int col=0; col < getNumTileColumnsMinus1(); col++)
351  {
352  m_tileParameters[row * numCols + col].setTileWidthInCtus( m_pps.getTileColumnWidth(col) );
353  cumulativeTileWidth += m_pps.getTileColumnWidth(col);
354  }
355  m_tileParameters[row * numCols + getNumTileColumnsMinus1()].setTileWidthInCtus( getFrameWidthInCtus()-cumulativeTileWidth );
356  }
357 
358  //set the height for each tile
359  for(Int col=0; col < numCols; col++)
360  {
361  Int cumulativeTileHeight = 0;
362  for(Int row=0; row < getNumTileRowsMinus1(); row++)
363  {
364  m_tileParameters[row * numCols + col].setTileHeightInCtus( m_pps.getTileRowHeight(row) );
365  cumulativeTileHeight += m_pps.getTileRowHeight(row);
366  }
367  m_tileParameters[getNumTileRowsMinus1() * numCols + col].setTileHeightInCtus( getFrameHeightInCtus()-cumulativeTileHeight );
368  }
369  }
370 
371  // Tile size check
372  Int minWidth = 1;
373  Int minHeight = 1;
374  const Int profileIdc = m_sps.getPTL()->getGeneralPTL()->getProfileIdc();
375  if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) //TODO: add more profiles to the tile-size check...
376  {
378  {
379  minHeight = 64 / m_sps.getMaxCUHeight();
380  minWidth = 256 / m_sps.getMaxCUWidth();
381  }
382  }
383  for(Int row=0; row < numRows; row++)
384  {
385  for(Int col=0; col < numCols; col++)
386  {
387  const Int tileIdx = row * numCols + col;
388  assert (m_tileParameters[tileIdx].getTileWidthInCtus() >= minWidth);
389  assert (m_tileParameters[tileIdx].getTileHeightInCtus() >= minHeight);
390  }
391  }
392 
393  //initialize each tile of the current picture
394  for( Int row=0; row < numRows; row++ )
395  {
396  for( Int col=0; col < numCols; col++ )
397  {
398  const Int tileIdx = row * numCols + col;
399 
400  //initialize the RightEdgePosInCU for each tile
401  Int rightEdgePosInCTU = 0;
402  for( Int i=0; i <= col; i++ )
403  {
404  rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidthInCtus();
405  }
406  m_tileParameters[tileIdx].setRightEdgePosInCtus(rightEdgePosInCTU-1);
407 
408  //initialize the BottomEdgePosInCU for each tile
409  Int bottomEdgePosInCTU = 0;
410  for( Int i=0; i <= row; i++ )
411  {
412  bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeightInCtus();
413  }
414  m_tileParameters[tileIdx].setBottomEdgePosInCtus(bottomEdgePosInCTU-1);
415 
416  //initialize the FirstCUAddr for each tile
417  m_tileParameters[tileIdx].setFirstCtuRsAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCtus() - m_tileParameters[tileIdx].getTileHeightInCtus() + 1) * getFrameWidthInCtus() +
418  m_tileParameters[tileIdx].getRightEdgePosInCtus() - m_tileParameters[tileIdx].getTileWidthInCtus() + 1);
419  }
420  }
421 
422  Int columnIdx = 0;
423  Int rowIdx = 0;
424 
425  //initialize the TileIdxMap
426  for( Int i=0; i<m_numCtusInFrame; i++)
427  {
428  for( Int col=0; col < numCols; col++)
429  {
430  if(i % getFrameWidthInCtus() <= m_tileParameters[col].getRightEdgePosInCtus())
431  {
432  columnIdx = col;
433  break;
434  }
435  }
436  for(Int row=0; row < numRows; row++)
437  {
438  if(i / getFrameWidthInCtus() <= m_tileParameters[row*numCols].getBottomEdgePosInCtus())
439  {
440  rowIdx = row;
441  break;
442  }
443  }
444  m_puiTileIdxMap[i] = rowIdx * numCols + columnIdx;
445  }
446 }
448 {
449  UInt nextCtuRsAddr;
450 
451  //get the tile index for the current CTU
452  const UInt uiTileIdx = getTileIdxMap(currCtuRsAddr);
453 
454  //get the raster scan address for the next CTU
455  if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() && currCtuRsAddr / m_frameWidthInCtus == getTComTile(uiTileIdx)->getBottomEdgePosInCtus() )
456  //the current CTU is the last CTU of the tile
457  {
458  if(uiTileIdx+1 == getNumTiles())
459  {
460  nextCtuRsAddr = m_numCtusInFrame;
461  }
462  else
463  {
464  nextCtuRsAddr = getTComTile(uiTileIdx+1)->getFirstCtuRsAddr();
465  }
466  }
467  else //the current CTU is not the last CTU of the tile
468  {
469  if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() ) //the current CTU is on the rightmost edge of the tile
470  {
471  nextCtuRsAddr = currCtuRsAddr + m_frameWidthInCtus - getTComTile(uiTileIdx)->getTileWidthInCtus() + 1;
472  }
473  else
474  {
475  nextCtuRsAddr = currCtuRsAddr + 1;
476  }
477  }
478 
479  return nextCtuRsAddr;
480 }
481 
483  Bool& isLeftAvail,
484  Bool& isRightAvail,
485  Bool& isAboveAvail,
486  Bool& isBelowAvail,
487  Bool& isAboveLeftAvail,
488  Bool& isAboveRightAvail,
489  Bool& isBelowLeftAvail,
490  Bool& isBelowRightAvail
491  )
492 {
493 
494  isLeftAvail = (ctuRsAddr % m_frameWidthInCtus != 0);
495  isRightAvail = (ctuRsAddr % m_frameWidthInCtus != m_frameWidthInCtus-1);
496  isAboveAvail = (ctuRsAddr >= m_frameWidthInCtus );
497  isBelowAvail = (ctuRsAddr < m_numCtusInFrame - m_frameWidthInCtus);
498  isAboveLeftAvail = (isAboveAvail && isLeftAvail);
499  isAboveRightAvail= (isAboveAvail && isRightAvail);
500  isBelowLeftAvail = (isBelowAvail && isLeftAvail);
501  isBelowRightAvail= (isBelowAvail && isRightAvail);
502 
503  Bool isLoopFiltAcrossTilePPS = getCtu(ctuRsAddr)->getSlice()->getPPS()->getLoopFilterAcrossTilesEnabledFlag();
504 
505  {
506  TComDataCU* ctuCurr = getCtu(ctuRsAddr);
507  TComDataCU* ctuLeft = isLeftAvail ?getCtu(ctuRsAddr-1):NULL;
508  TComDataCU* ctuRight = isRightAvail?getCtu(ctuRsAddr+1):NULL;
509  TComDataCU* ctuAbove = isAboveAvail?getCtu(ctuRsAddr-m_frameWidthInCtus):NULL;
510  TComDataCU* ctuBelow = isBelowAvail?getCtu(ctuRsAddr+m_frameWidthInCtus):NULL;
511  TComDataCU* ctuAboveLeft = isAboveLeftAvail ? getCtu(ctuRsAddr-m_frameWidthInCtus-1):NULL;
512  TComDataCU* ctuAboveRight = isAboveRightAvail? getCtu(ctuRsAddr-m_frameWidthInCtus+1):NULL;
513  TComDataCU* ctuBelowLeft = isBelowLeftAvail ? getCtu(ctuRsAddr+m_frameWidthInCtus-1):NULL;
514  TComDataCU* ctuBelowRight = isBelowRightAvail? getCtu(ctuRsAddr+m_frameWidthInCtus+1):NULL;
515 
516  {
517  //left
518  if(ctuLeft != NULL)
519  {
520  isLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;
521  }
522  //above
523  if(ctuAbove != NULL)
524  {
525  isAboveAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAbove->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;
526  }
527  //right
528  if(ctuRight != NULL)
529  {
530  isRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuRight->getSlice()->getLFCrossSliceBoundaryFlag():true;
531  }
532  //below
533  if(ctuBelow != NULL)
534  {
535  isBelowAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelow->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelow->getSlice()->getLFCrossSliceBoundaryFlag():true;
536  }
537  //above-left
538  if(ctuAboveLeft != NULL)
539  {
540  isAboveLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAboveLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true;
541  }
542  //below-right
543  if(ctuBelowRight != NULL)
544  {
545  isBelowRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelowRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelowRight->getSlice()->getLFCrossSliceBoundaryFlag():true;
546  }
547 
548  //above-right
549  if(ctuAboveRight != NULL)
550  {
551  Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr();
552  Int aboveRightSliceStartTsAddr = ctuAboveRight->getSlice()->getSliceCurStartCtuTsAddr();
553 
554  isAboveRightAvail = (curSliceStartTsAddr == aboveRightSliceStartTsAddr)?(true):
555  (
556  (curSliceStartTsAddr > aboveRightSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag())
557  :(ctuAboveRight->getSlice()->getLFCrossSliceBoundaryFlag())
558  );
559  }
560  //below-left
561  if(ctuBelowLeft != NULL)
562  {
563  Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr();
564  Int belowLeftSliceStartTsAddr = ctuBelowLeft->getSlice()->getSliceCurStartCtuTsAddr();
565 
566  isBelowLeftAvail = (curSliceStartTsAddr == belowLeftSliceStartTsAddr)?(true):
567  (
568  (curSliceStartTsAddr > belowLeftSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag())
569  :(ctuBelowLeft->getSlice()->getLFCrossSliceBoundaryFlag())
570  );
571  }
572  }
573 
574  if(!isLoopFiltAcrossTilePPS)
575  {
576  isLeftAvail = (!isLeftAvail ) ?false:(getTileIdxMap( ctuLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
577  isAboveAvail = (!isAboveAvail ) ?false:(getTileIdxMap( ctuAbove->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
578  isRightAvail = (!isRightAvail ) ?false:(getTileIdxMap( ctuRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
579  isBelowAvail = (!isBelowAvail ) ?false:(getTileIdxMap( ctuBelow->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
580  isAboveLeftAvail = (!isAboveLeftAvail ) ?false:(getTileIdxMap( ctuAboveLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
581  isAboveRightAvail= (!isAboveRightAvail) ?false:(getTileIdxMap( ctuAboveRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
582  isBelowLeftAvail = (!isBelowLeftAvail ) ?false:(getTileIdxMap( ctuBelowLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
583  isBelowRightAvail= (!isBelowRightAvail) ?false:(getTileIdxMap( ctuBelowRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr ));
584  }
585  }
586 
587 }
588 
589 
591 : m_tileWidthInCtus (0)
592 , m_tileHeightInCtus (0)
593 , m_rightEdgePosInCtus (0)
594 , m_bottomEdgePosInCtus (0)
595 , m_firstCtuRsAddr (0)
596 {
597 }
598 
600 {
601 }
602 
603 #if MCTS_ENC_CHECK
604 
605 Void getTilePosition(const TComDataCU* const pcCU, UInt &tileXPosInCtus, UInt &tileYPosInCtus, UInt &tileWidthtInCtus, UInt &tileHeightInCtus)
606 {
607  const UInt currentTileIdx = pcCU->getPic()->getPicSym()->getTileIdxMap(pcCU->getCtuRsAddr());
608  const TComTile *pCurrentTile = pcCU->getPic()->getPicSym()->getTComTile(currentTileIdx);
609  const UInt frameWidthInCtus = pcCU->getPic()->getPicSym()->getFrameWidthInCtus();
610  const UInt firstCtuRsAddrOfTile = pcCU->getPic()->getPicSym()->getTComTile(pcCU->getPic()->getPicSym()->getTileIdxMap(pcCU->getCtuRsAddr()))->getFirstCtuRsAddr();
611 
612  tileXPosInCtus = firstCtuRsAddrOfTile % frameWidthInCtus;
613  tileYPosInCtus = firstCtuRsAddrOfTile / frameWidthInCtus;
614  tileWidthtInCtus = pCurrentTile->getTileWidthInCtus();
615  tileHeightInCtus = pCurrentTile->getTileHeightInCtus();
616 }
617 
618 #endif
619 
Int getNumTileRowsMinus1() const
Definition: TComSlice.h:1163
sample adaptive offset class (header)
UInt getFirstCtuRsAddr() const
Definition: TComPicSym.h:79
UInt * m_ctuRsToTsAddrMap
for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification.
Definition: TComPicSym.h:106
CU data structure class.
Definition: TComDataCU.h:64
TComPPS m_pps
Definition: TComPicSym.h:131
Int getNumTileColumnsMinus1() const
Definition: TComSlice.h:1159
void Void
Definition: TypeDef.h:203
UInt * m_puiTileIdxMap
the map of the tile index relative to CTU raster scan address
Definition: TComPicSym.h:105
Void setNumTileRowsMinus1(Int i)
Definition: TComPicSym.h:136
Int getNumTileColumnsMinus1() const
Definition: TComPicSym.h:178
#define NULL
Definition: CommonDef.h:107
slice header and SPS class (header)
Void setNumTileColumnsMinus1(Int i)
Definition: TComPicSym.h:135
unsigned int UInt
Definition: TypeDef.h:212
Void create(const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray)
Definition: TComPicSym.cpp:83
Void allocateNewSlice()
Definition: TComPicSym.cpp:285
UInt getMaxCUHeight() const
Definition: TComSlice.h:859
Void releaseAllReconstructionData()
Definition: TComPicSym.cpp:221
std::deque< TComSlice * > m_apSlices
Definition: TComPicSym.h:98
DPBPerCtuData * m_dpbPerCtuData
Definition: TComPicSym.h:124
ChromaFormat getChromaFormatIdc() const
Definition: TComSlice.h:826
UInt m_numCtusInFrame
Definition: TComPicSym.h:96
#define REDUCED_ENCODER_MEMORY
When 1, the encoder will allocate TComPic memory when required and release it when no longer required...
Definition: TypeDef.h:110
UInt getTileRowHeight(UInt rowIdx) const
Definition: TComSlice.h:1165
UInt getFrameWidthInCtus() const
Definition: TComPicSym.h:156
Int getNumTileRowsMinus1() const
Definition: TComPicSym.h:179
Bool getTilesEnabledFlag() const
Definition: TComSlice.h:1155
picture symbol class (header)
ProfileTierLevel * getGeneralPTL()
Definition: TComSlice.h:265
UInt getTileWidthInCtus() const
Definition: TComPicSym.h:71
UInt getTileIdxMap(Int ctuRsAddr) const
Definition: TComPicSym.h:184
signed char SChar
Definition: TypeDef.h:207
bool Bool
Definition: TypeDef.h:204
UInt m_frameWidthInCtus
Definition: TComPicSym.h:86
TComDataCU ** m_pictureCtuArray
array of CU data.
Definition: TComPicSym.h:99
#define ADAPTIVE_QP_SELECTION
G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection.
Definition: TypeDef.h:112
Int getNumTiles() const
Definition: TComPicSym.h:180
PPS class.
Definition: TComSlice.h:1034
UInt & getCtuRsAddr()
Definition: TComDataCU.h:204
UInt getPicHeightInLumaSamples() const
Definition: TComSlice.h:836
Void xInitCtuTsRsAddrMaps()
Definition: TComPicSym.cpp:306
Int TCoeff
transform coefficient
Definition: TypeDef.h:250
Bool getLFCrossSliceBoundaryFlag()
Definition: TComSlice.h:1533
TCoeff * m_pParentARLBuffer
Definition: TComPicSym.h:128
Void destroy()
Definition: TComPicSym.cpp:242
const TComPTL * getPTL() const
Definition: TComSlice.h:938
TComPicSym * getPicSym()
Definition: TComPic.h:111
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Definition: TypeDef.h:292
const TComPPS * getPPS() const
Definition: TComSlice.h:1332
UInt getPicWidthInLumaSamples() const
Definition: TComSlice.h:834
UInt getTileColumnWidth(UInt columnIdx) const
Definition: TComSlice.h:1161
Profile::Name getProfileIdc() const
Definition: TComSlice.h:212
UInt getFrameHeightInCtus() const
Definition: TComPicSym.h:157
UInt getTileHeightInCtus() const
Definition: TComPicSym.h:73
std::vector< TComTile > m_tileParameters
Definition: TComPicSym.h:103
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPicSym.h:161
UInt getSliceCurStartCtuTsAddr() const
Definition: TComSlice.h:1481
UChar m_uhTotalDepth
max. depth
Definition: TComPicSym.h:92
Void setCtuTsToRsAddrMap(Int ctuTsAddr, Int ctuRsAddr)
Definition: TComPicSym.h:137
TComSPS m_sps
Definition: TComPicSym.h:130
TComPic * getPic()
Definition: TComDataCU.h:200
UInt m_numPartitionsInCtu
Definition: TComPicSym.h:93
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
Definition: TComDataCU.cpp:109
Void prepareForReconstruction()
Definition: TComPicSym.cpp:166
UInt * m_ctuTsToRsAddrMap
for a given TS (Tile-Scan; coding order) address, returns the RS (Raster-Scan) address. cf CtbAddrTsToRs in specification.
Definition: TComPicSym.h:104
Void deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, Bool &isLeftAvail, Bool &isRightAvail, Bool &isAboveAvail, Bool &isBelowAvail, Bool &isAboveLeftAvail, Bool &isAboveRightAvail, Bool &isBelowLeftAvail, Bool &isBelowRightAvail)
Definition: TComPicSym.cpp:482
TComTile * getTComTile(UInt tileIdx)
Definition: TComPicSym.h:181
SAOBlkParam * m_saoBlkParams
Definition: TComPicSym.h:126
Void destroy()
Definition: TComDataCU.cpp:208
UInt getNumberOfCtusInFrame() const
Definition: TComPicSym.h:160
int Int
Definition: TypeDef.h:211
UInt xCalculateNextCtuRSAddr(UInt uiCurrCtuRSAddr)
Definition: TComPicSym.cpp:447
virtual ~TComTile()
Definition: TComPicSym.cpp:599
Void clearSliceBuffer()
Definition: TComPicSym.cpp:297
Bool getTileUniformSpacingFlag() const
Definition: TComSlice.h:1157
Void setCtuRsToTsAddrMap(Int ctuRsAddr, Int ctuTsOrder)
Definition: TComPicSym.h:138
Bool getLoopFilterAcrossTilesEnabledFlag() const
Definition: TComSlice.h:1148
Void releaseReconstructionIntermediateData()
Definition: TComPicSym.cpp:203
TComCUMvField m_CUMvField[NUM_REF_PIC_LIST_01]
Definition: TComPicSym.h:119
Void create(UInt uiNumPartition)
slice header class
Definition: TComSlice.h:1225
Void xInitTiles()
Definition: TComPicSym.cpp:318
Void getTilePosition(const TComDataCU *const pcCU, UInt &tileXPosInCtus, UInt &tileYPosInCtus, UInt &tileWidthtInCtus, UInt &tileHeightInCtus)
Definition: TComPicSym.cpp:605
UInt getMaxCUWidth() const
Definition: TComSlice.h:857
TComSlice * getSlice()
Definition: TComDataCU.h:202
SPS class.
Definition: TComSlice.h:740