HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TDecCu.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 "TDecCu.h"
39 #include "TLibCommon/TComTU.h"
41 
44 
45 // ====================================================================================================================
46 // Constructor / destructor / create / destroy
47 // ====================================================================================================================
48 
50 {
53  m_ppcCU = NULL;
54 }
55 
57 {
58 }
59 
60 #if MCTS_ENC_CHECK
61 Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, TDecConformanceCheck* pConformanceCheck)
62 #else
63 Void TDecCu::init(TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction)
64 #endif
65 {
66  m_pcEntropyDecoder = pcEntropyDecoder;
67  m_pcTrQuant = pcTrQuant;
68  m_pcPrediction = pcPrediction;
69 #if MCTS_ENC_CHECK
70  m_pConformanceCheck = pConformanceCheck;
71 #endif
72 }
73 
80 Void TDecCu::create( UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC )
81 {
82  m_uiMaxDepth = uiMaxDepth+1;
83 
87 
88  for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ )
89  {
90  UInt uiNumPartitions = 1<<( ( m_uiMaxDepth - ui - 1 )<<1 );
91  UInt uiWidth = uiMaxWidth >> ui;
92  UInt uiHeight = uiMaxHeight >> ui;
93 
94  // The following arrays (m_ppcYuvResi, m_ppcYuvReco and m_ppcCU) are only required for CU depths
95  // although data is allocated for all possible depths of the CU/TU tree except the last.
96  // Since the TU tree will always include at least one additional depth greater than the CU tree,
97  // there will be enough entries for these arrays.
98  // (Section 7.4.3.2: "The CVS shall not contain data that result in (Log2MinTrafoSize) MinTbLog2SizeY
99  // greater than or equal to MinCbLog2SizeY")
100  // TODO: tidy the array allocation given the above comment.
101 
102  m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
103  m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
104  m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );
105  }
106 
107  m_bDecodeDQP = false;
108  m_IsChromaQpAdjCoded = false;
109 
110  // initialize partition order.
111  UInt* piTmp = &g_auiZscanToRaster[0];
112  initZscanToRaster(m_uiMaxDepth, 1, 0, piTmp);
113  initRasterToZscan( uiMaxWidth, uiMaxHeight, m_uiMaxDepth );
114 
115  // initialize conversion matrix from partition index to pel
116  initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth );
117 }
118 
120 {
121  for ( UInt ui = 0; ui < m_uiMaxDepth-1; ui++ )
122  {
123  m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
124  m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
125  m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL;
126  }
127 
128  delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
129  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
130  delete [] m_ppcCU ; m_ppcCU = NULL;
131 }
132 
133 // ====================================================================================================================
134 // Public member functions
135 // ====================================================================================================================
136 
142 Void TDecCu::decodeCtu( TComDataCU* pCtu, Bool& isLastCtuOfSliceSegment )
143 {
144  if ( pCtu->getSlice()->getPPS()->getUseDQP() )
145  {
146  setdQPFlag(true);
147  }
148 
149  if ( pCtu->getSlice()->getUseChromaQpAdj() )
150  {
151  setIsChromaQpAdjCoded(true);
152  }
153 
154  // start from the top level CU
155  xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment);
156 }
157 
163 {
164  xDecompressCU( pCtu, 0, 0 );
165 }
166 
167 // ====================================================================================================================
168 // Protected member functions
169 // ====================================================================================================================
170 
173 {
174  UInt uiIsLastCtuOfSliceSegment;
175 
176  if (pcCU->isLastSubCUOfCtu(uiAbsPartIdx))
177  {
178  m_pcEntropyDecoder->decodeTerminatingBit( uiIsLastCtuOfSliceSegment );
179  }
180  else
181  {
182  uiIsLastCtuOfSliceSegment=0;
183  }
184 
185  return uiIsLastCtuOfSliceSegment>0;
186 }
187 
189 Void TDecCu::xDecodeCU( TComDataCU*const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment)
190 {
191  TComPic* pcPic = pcCU->getPic();
192  const TComSPS &sps = pcPic->getPicSym()->getSPS();
193  const TComPPS &pps = pcPic->getPicSym()->getPPS();
194  const UInt maxCuWidth = sps.getMaxCUWidth();
195  const UInt maxCuHeight= sps.getMaxCUHeight();
196  UInt uiCurNumParts = pcPic->getNumPartitionsInCtu() >> (uiDepth<<1);
197  UInt uiQNumParts = uiCurNumParts>>2;
198 
199 
200  Bool bBoundary = false;
201  UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
202  UInt uiRPelX = uiLPelX + (maxCuWidth>>uiDepth) - 1;
203  UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
204  UInt uiBPelY = uiTPelY + (maxCuHeight>>uiDepth) - 1;
205 
206  if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
207  {
208  m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
209  }
210  else
211  {
212  bBoundary = true;
213  }
214  if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
215  {
216  UInt uiIdx = uiAbsPartIdx;
217  if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
218  {
219  setdQPFlag(true);
220  pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
221  }
222 
223  if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
224  {
225  setIsChromaQpAdjCoded(true);
226  }
227 
228  for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
229  {
230  uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ];
231  uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ];
232 
233  if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
234  {
235  xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment );
236  }
237  else
238  {
239  pcCU->setOutsideCUPart( uiIdx, uiDepth+1 );
240  }
241 
242  uiIdx += uiQNumParts;
243  }
244  if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
245  {
246  if ( getdQPFlag() )
247  {
248  UInt uiQPSrcPartIdx = uiAbsPartIdx;
249  pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP
250  }
251  }
252  return;
253  }
254 
255  if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP())
256  {
257  setdQPFlag(true);
258  pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
259  }
260 
261  if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
262  {
263  setIsChromaQpAdjCoded(true);
264  }
265 
267  {
268  m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth );
269  }
270 
271  // decode CU mode and the partition size
272  if( !pcCU->getSlice()->isIntra())
273  {
274  m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
275  }
276 
277 
278  if( pcCU->isSkipped(uiAbsPartIdx) )
279  {
280  m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
281  m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
282  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
283  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
284  Int numValidMergeCand = 0;
285  for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui )
286  {
287  uhInterDirNeighbours[ui] = 0;
288  }
289  m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
290  UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
291 #if MCTS_ENC_CHECK
292  UInt numSpatialMergeCandidates = 0;
293  m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex );
294  if ( m_pConformanceCheck->getTMctsCheck() && m_ppcCU[uiDepth]->isLastColumnCTUInTile() && (uiMergeIndex >= numSpatialMergeCandidates) )
295  {
296  m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (Skip)");
297  }
298 #else
299  m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
300 #endif
301  pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
302 
303  TComMv cTmpMv( 0, 0 );
304  for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
305  {
306  if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
307  {
308  pcCU->setMVPIdxSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth);
309  pcCU->setMVPNumSubParts( 0, RefPicList( uiRefListIdx ), uiAbsPartIdx, 0, uiDepth);
310  pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
311  pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
312  }
313  }
314  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
315  return;
316  }
317 
318  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
319  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
320 
321  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
322  {
323  m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
324 
325  if(pcCU->getIPCMFlag(uiAbsPartIdx))
326  {
327  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
328  return;
329  }
330  }
331 
332  // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
333  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
334 
335  // Coefficient decoding
336  Bool bCodeDQP = getdQPFlag();
337  Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded();
338  m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded );
339  setIsChromaQpAdjCoded( isChromaQpAdjCoded );
340  setdQPFlag( bCodeDQP );
341  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
342 }
343 
344 Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &isLastCtuOfSliceSegment)
345 {
346  if( pcCU->getSlice()->getPPS()->getUseDQP())
347  {
348  pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP
349  }
350 
351  if (pcCU->getSlice()->getUseChromaQpAdj() && !getIsChromaQpAdjCoded())
352  {
353  pcCU->setChromaQpAdjSubParts( pcCU->getCodedChromaQpAdj(), uiAbsPartIdx, uiDepth ); // set QP
354  }
355 
356  isLastCtuOfSliceSegment = xDecodeSliceEnd( pcCU, uiAbsPartIdx );
357 }
358 
359 Void TDecCu::xDecompressCU( TComDataCU* pCtu, UInt uiAbsPartIdx, UInt uiDepth )
360 {
361  TComPic* pcPic = pCtu->getPic();
362  TComSlice * pcSlice = pCtu->getSlice();
363  const TComSPS &sps=*(pcSlice->getSPS());
364 
365  Bool bBoundary = false;
366  UInt uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
367  UInt uiRPelX = uiLPelX + (sps.getMaxCUWidth()>>uiDepth) - 1;
368  UInt uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
369  UInt uiBPelY = uiTPelY + (sps.getMaxCUHeight()>>uiDepth) - 1;
370 
371  if( ( uiRPelX >= sps.getPicWidthInLumaSamples() ) || ( uiBPelY >= sps.getPicHeightInLumaSamples() ) )
372  {
373  bBoundary = true;
374  }
375 
376  if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
377  {
378  UInt uiNextDepth = uiDepth + 1;
379  UInt uiQNumParts = pCtu->getTotalNumPart() >> (uiNextDepth<<1);
380  UInt uiIdx = uiAbsPartIdx;
381  for ( UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++ )
382  {
383  uiLPelX = pCtu->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ];
384  uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ];
385 
386  if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
387  {
388  xDecompressCU(pCtu, uiIdx, uiNextDepth );
389  }
390 
391  uiIdx += uiQNumParts;
392  }
393  return;
394  }
395 
396  // Residual reconstruction
397  m_ppcYuvResi[uiDepth]->clear();
398 
399  m_ppcCU[uiDepth]->copySubCU( pCtu, uiAbsPartIdx );
400 
401  switch( m_ppcCU[uiDepth]->getPredictionMode(0) )
402  {
403  case MODE_INTER:
404  xReconInter( m_ppcCU[uiDepth], uiDepth );
405  break;
406  case MODE_INTRA:
407  xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
408  break;
409  default:
410  assert(0);
411  break;
412  }
413 
414 #if DEBUG_STRING
415  const PredMode predMode=m_ppcCU[uiDepth]->getPredictionMode(0);
416  if (DebugOptionList::DebugString_Structure.getInt()&DebugStringGetPredModeMask(predMode))
417  {
418  PartSize eSize=m_ppcCU[uiDepth]->getPartitionSize(0);
419  std::ostream &ss(std::cout);
420 
421  ss <<"###: " << (predMode==MODE_INTRA?"Intra ":"Inter ") << partSizeToString[eSize] << " CU at " << m_ppcCU[uiDepth]->getCUPelX() << ", " << m_ppcCU[uiDepth]->getCUPelY() << " width=" << UInt(m_ppcCU[uiDepth]->getWidth(0)) << std::endl;
422  }
423 #endif
424 
425  if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false))
426  {
427  xFillPCMBuffer(m_ppcCU[uiDepth], uiDepth);
428  }
429 
430  xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth );
431 }
432 
434 {
435 
436  // inter prediction
437 #if MCTS_ENC_CHECK
439  {
440  m_pConformanceCheck->flagTMctsError("motion vector across tile boundaries");
441  }
442 #endif
444 
445 #if DEBUG_STRING
446  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER);
447  if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask)
448  {
449  printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth]));
450  }
451 #endif
452 
453  // inter recon
454  xDecodeInterTexture( pcCU, uiDepth );
455 
456 #if DEBUG_STRING
457  if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask)
458  {
459  printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth]));
460  }
461 #endif
462 
463  // clip for only non-zero cbp case
464  if ( pcCU->getQtRootCbf( 0) )
465  {
466  m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() );
467  }
468  else
469  {
470  m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));
471  }
472 #if DEBUG_STRING
473  if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask)
474  {
475  printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth]));
476  }
477 #endif
478 
479 }
480 
481 
482 Void
484  TComYuv* pcPredYuv,
485  TComYuv* pcResiYuv,
486  const ComponentID compID,
487  TComTU &rTu)
488 {
489  if (!rTu.ProcessComponentSection(compID))
490  {
491  return;
492  }
493  const Bool bIsLuma = isLuma(compID);
494 
495 
496  TComDataCU *pcCU = rTu.getCU();
497  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
498  const UInt uiAbsPartIdx=rTu.GetAbsPartIdxTU();
499 
500  const TComRectangle &tuRect =rTu.getRect(compID);
501  const UInt uiWidth = tuRect.width;
502  const UInt uiHeight = tuRect.height;
503  const UInt uiStride = pcRecoYuv->getStride (compID);
504  Pel* piPred = pcPredYuv->getAddr( compID, uiAbsPartIdx );
505  const ChromaFormat chFmt = rTu.GetChromaFormat();
506 
507  if (uiWidth != uiHeight)
508  {
509  //------------------------------------------------
510 
511  //split at current level if dividing into square sub-TUs
512 
513  TComTURecurse subTURecurse(rTu, false, TComTU::VERTICAL_SPLIT, true, compID);
514 
515  //recurse further
516  do
517  {
518  xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse);
519  } while (subTURecurse.nextSection(rTu));
520 
521  //------------------------------------------------
522 
523  return;
524  }
525 
526  const UInt uiChPredMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx );
527  const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize()));
528  const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
529  const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
530 
531  //===== init availability pattern =====
532  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
533 
534 #if DEBUG_STRING
535  std::ostream &ss(std::cout);
536 #endif
537 
538  DEBUG_STRING_NEW(sTemp)
539  m_pcPrediction->initIntraPatternChType( rTu, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) );
540 
541 
542  //===== get prediction signal =====
543 
544  m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bUseFilteredPredictions );
545 
546 #if DEBUG_STRING
547  ss << sTemp;
548 #endif
549 
550  //===== inverse transform =====
551  Pel* piResi = pcResiYuv->getAddr( compID, uiAbsPartIdx );
552  TCoeff* pcCoeff = pcCU->getCoeff(compID) + rTu.getCoefficientOffset(compID);//( uiNumCoeffInc * uiAbsPartIdx );
553 
554  const QpParam cQP(*pcCU, compID);
555 
556 
557  DEBUG_STRING_NEW(sDebug);
558 #if DEBUG_STRING
559  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTRA);
560  std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0;
561 #endif
562 
563  if (pcCU->getCbf(uiAbsPartIdx, compID, rTu.GetTransformDepthRel()) != 0)
564  {
565  m_pcTrQuant->invTransformNxN( rTu, compID, piResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) );
566  }
567  else
568  {
569  for (UInt y = 0; y < uiHeight; y++)
570  {
571  for (UInt x = 0; x < uiWidth; x++)
572  {
573  piResi[(y * uiStride) + x] = 0;
574  }
575  }
576  }
577 
578 #if DEBUG_STRING
579  if (psDebug)
580  {
581  ss << (*psDebug);
582  }
583 #endif
584 
585  //===== reconstruction =====
586  const UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride(compID);
587 
588  const Bool useCrossComponentPrediction = isChroma(compID) && (pcCU->getCrossComponentPredictionAlpha(uiAbsPartIdx, compID) != 0);
589  const Pel* pResiLuma = pcResiYuv->getAddr( COMPONENT_Y, uiAbsPartIdx );
590  const Int strideLuma = pcResiYuv->getStride( COMPONENT_Y );
591 
592  Pel* pPred = piPred;
593  Pel* pResi = piResi;
594  Pel* pReco = pcRecoYuv->getAddr( compID, uiAbsPartIdx );
595  Pel* pRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx );
596 
597 
598 #if DEBUG_STRING
599  const Bool bDebugPred=((DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
600  const Bool bDebugResi=((DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
601  const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
602  if (bDebugPred || bDebugResi || bDebugReco)
603  {
604  ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl;
605  }
606 #endif
607 
608  const Int clipbd = sps.getBitDepth(toChannelType(compID));
609 #if O0043_BEST_EFFORT_DECODING
610  const Int bitDepthDelta = sps.getStreamBitDepth(toChannelType(compID)) - clipbd;
611 #endif
612 
613  if( useCrossComponentPrediction )
614  {
615  TComTrQuant::crossComponentPrediction( rTu, compID, pResiLuma, piResi, piResi, uiWidth, uiHeight, strideLuma, uiStride, uiStride, true );
616  }
617 
618  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
619  {
620 #if DEBUG_STRING
621  if (bDebugPred || bDebugResi || bDebugReco)
622  {
623  ss << "###: ";
624  }
625 
626  if (bDebugPred)
627  {
628  ss << " - pred: ";
629  for( UInt uiX = 0; uiX < uiWidth; uiX++ )
630  {
631  ss << pPred[ uiX ] << ", ";
632  }
633  }
634  if (bDebugResi)
635  {
636  ss << " - resi: ";
637  }
638 #endif
639 
640  for( UInt uiX = 0; uiX < uiWidth; uiX++ )
641  {
642 #if DEBUG_STRING
643  if (bDebugResi)
644  {
645  ss << pResi[ uiX ] << ", ";
646  }
647 #endif
648 #if O0043_BEST_EFFORT_DECODING
649  pReco [ uiX ] = ClipBD( rightShiftEvenRounding<Pel>(pPred[ uiX ] + pResi[ uiX ], bitDepthDelta), clipbd );
650 #else
651  pReco [ uiX ] = ClipBD( pPred[ uiX ] + pResi[ uiX ], clipbd );
652 #endif
653  pRecIPred[ uiX ] = pReco[ uiX ];
654  }
655 #if DEBUG_STRING
656  if (bDebugReco)
657  {
658  ss << " - reco: ";
659  for( UInt uiX = 0; uiX < uiWidth; uiX++ )
660  {
661  ss << pReco[ uiX ] << ", ";
662  }
663  }
664 
665  if (bDebugPred || bDebugResi || bDebugReco)
666  {
667  ss << "\n";
668  }
669 #endif
670  pPred += uiStride;
671  pResi += uiStride;
672  pReco += uiStride;
673  pRecIPred += uiRecIPredStride;
674  }
675 }
676 
677 
678 Void
680 {
681  if (pcCU->getIPCMFlag(0))
682  {
683  xReconPCM( pcCU, uiDepth );
684  return;
685  }
686  const UInt numChType = pcCU->getPic()->getChromaFormat()!=CHROMA_400 ? 2 : 1;
687  for (UInt chType=CHANNEL_TYPE_LUMA; chType<numChType; chType++)
688  {
689  const ChannelType chanType=ChannelType(chType);
690  const Bool NxNPUHas4Parts = ::isChroma(chanType) ? enable4ChromaPUsInIntraNxNCU(pcCU->getPic()->getChromaFormat()) : true;
691  const UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) != SIZE_2Nx2N && NxNPUHas4Parts ? 1 : 0 );
692 
693  TComTURecurse tuRecurseCU(pcCU, 0);
694  TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (uiInitTrDepth==0)?TComTU::DONT_SPLIT : TComTU::QUAD_SPLIT);
695 
696  do
697  {
698  xIntraRecQT( m_ppcYuvReco[uiDepth], m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], chanType, tuRecurseWithPU );
699  } while (tuRecurseWithPU.nextSection(tuRecurseCU));
700  }
701 }
702 
703 
704 
715 Void
717  TComYuv* pcPredYuv,
718  TComYuv* pcResiYuv,
719  const ChannelType chType,
720  TComTU &rTu)
721 {
722  UInt uiTrDepth = rTu.GetTransformDepthRel();
723  TComDataCU *pcCU = rTu.getCU();
724  UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
725  UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx );
726  if( uiTrMode == uiTrDepth )
727  {
728  if (isLuma(chType))
729  {
730  xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y, rTu );
731  }
732  else
733  {
734  const UInt numValidComp=getNumberValidComponents(rTu.GetChromaFormat());
735  for(UInt compID=COMPONENT_Cb; compID<numValidComp; compID++)
736  {
737  xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, ComponentID(compID), rTu );
738  }
739  }
740  }
741  else
742  {
743  TComTURecurse tuRecurseChild(rTu, false);
744  do
745  {
746  xIntraRecQT( pcRecoYuv, pcPredYuv, pcResiYuv, chType, tuRecurseChild );
747  } while (tuRecurseChild.nextSection(rTu));
748  }
749 }
750 
751 Void TDecCu::xCopyToPic( TComDataCU* pcCU, TComPic* pcPic, UInt uiZorderIdx, UInt uiDepth )
752 {
753  UInt uiCtuRsAddr = pcCU->getCtuRsAddr();
754 
755  m_ppcYuvReco[uiDepth]->copyToPicYuv ( pcPic->getPicYuvRec (), uiCtuRsAddr, uiZorderIdx );
756 
757  return;
758 }
759 
761 {
762 
763  TComTURecurse tuRecur(pcCU, 0, uiDepth);
764 
765  for(UInt ch=0; ch<pcCU->getPic()->getNumberValidComponents(); ch++)
766  {
767  const ComponentID compID=ComponentID(ch);
768  DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[compID])
769 
770  m_pcTrQuant->invRecurTransformNxN ( compID, m_ppcYuvResi[uiDepth], tuRecur );
771  }
772 
773  DEBUG_STRING_OUTPUT(std::cout, debug_reorder_data_inter_token[MAX_NUM_COMPONENT])
774 }
775 
787 Void TDecCu::xDecodePCMTexture( TComDataCU* pcCU, const UInt uiPartIdx, const Pel *piPCM, Pel* piReco, const UInt uiStride, const UInt uiWidth, const UInt uiHeight, const ComponentID compID)
788 {
789  Pel* piPicReco = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiPartIdx);
790  const UInt uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(compID);
791  const TComSPS &sps = *(pcCU->getSlice()->getSPS());
792  const UInt uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID));
793 
794  for(UInt uiY = 0; uiY < uiHeight; uiY++ )
795  {
796  for(UInt uiX = 0; uiX < uiWidth; uiX++ )
797  {
798  piReco[uiX] = (piPCM[uiX] << uiPcmLeftShiftBit);
799  piPicReco[uiX] = piReco[uiX];
800  }
801  piPCM += uiWidth;
802  piReco += uiStride;
803  piPicReco += uiPicStride;
804  }
805 }
806 
813 {
814  const UInt maxCuWidth = pcCU->getSlice()->getSPS()->getMaxCUWidth();
815  const UInt maxCuHeight = pcCU->getSlice()->getSPS()->getMaxCUHeight();
816  for (UInt ch=0; ch < pcCU->getPic()->getNumberValidComponents(); ch++)
817  {
818  const ComponentID compID = ComponentID(ch);
819  const UInt width = (maxCuWidth >>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleX(compID)));
820  const UInt height = (maxCuHeight>>(uiDepth+m_ppcYuvResi[uiDepth]->getComponentScaleY(compID)));
821  const UInt stride = m_ppcYuvResi[uiDepth]->getStride(compID);
822  Pel * pPCMChannel = pcCU->getPCMSample(compID);
823  Pel * pRecChannel = m_ppcYuvReco[uiDepth]->getAddr(compID);
824  xDecodePCMTexture( pcCU, 0, pPCMChannel, pRecChannel, stride, width, height, compID );
825  }
826 }
827 
833 {
834  const ChromaFormat format = pCU->getPic()->getChromaFormat();
835  const UInt numValidComp = getNumberValidComponents(format);
836  const UInt maxCuWidth = pCU->getSlice()->getSPS()->getMaxCUWidth();
837  const UInt maxCuHeight = pCU->getSlice()->getSPS()->getMaxCUHeight();
838 
839  for (UInt componentIndex = 0; componentIndex < numValidComp; componentIndex++)
840  {
841  const ComponentID component = ComponentID(componentIndex);
842 
843  const UInt width = maxCuWidth >> (depth + getComponentScaleX(component, format));
844  const UInt height = maxCuHeight >> (depth + getComponentScaleY(component, format));
845 
846  Pel *source = m_ppcYuvReco[depth]->getAddr(component, 0, width);
847  Pel *destination = pCU->getPCMSample(component);
848 
849  const UInt sourceStride = m_ppcYuvReco[depth]->getStride(component);
850 
851  for (Int line = 0; line < height; line++)
852  {
853  for (Int column = 0; column < width; column++)
854  {
855  destination[column] = source[column];
856  }
857 
858  source += sourceStride;
859  destination += width;
860  }
861  }
862 }
863 
Void xIntraRecQT(TComYuv *pcRecoYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, const ChannelType chType, TComTU &rTu)
Definition: TDecCu.cpp:716
Void xFinishDecodeCU(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &isLastCtuOfSliceSegment)
Definition: TDecCu.cpp:344
Void setMVPNumSubParts(Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Void destroy()
Destroy YUV buffer.
Definition: TComYuv.cpp:79
Void decodeSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Definition: TDecEntropy.cpp:97
UInt m_uiMaxDepth
max. number of depth
Definition: TDecCu.h:60
Void decodeCtu(TComDataCU *pCtu, Bool &isLastCtuOfSliceSegment)
decode Ctu information
Definition: TDecCu.cpp:142
Void decodeSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Definition: TDecEntropy.cpp:58
SChar * getPartitionSize()
Definition: TComDataCU.h:226
CU data structure class.
Definition: TComDataCU.h:64
static UInt getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, const ChromaFormat chFmt, const Int partsPerMinCU)
ChannelType
Definition: TypeDef.h:301
Void xFillPCMBuffer(TComDataCU *pCU, UInt depth)
Definition: TDecCu.cpp:832
prediction class (header)
TComTrQuant * m_pcTrQuant
Definition: TDecCu.h:66
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
void Void
Definition: TypeDef.h:203
Void getInterMergeCandidates(UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField *pcMFieldNeighbours, UChar *puhInterDirNeighbours, Int &numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx=-1) const
Construct a list of merging candidates.
const TComPPS & getPPS() const
Definition: TComPicSym.h:164
const TComPPSRExt & getPpsRangeExtension() const
Definition: TComSlice.h:1197
Int getStride(const ComponentID id) const
Definition: TComPicYuv.h:121
static const Int DM_CHROMA_IDX
chroma mode index for derived from luma intra mode
Definition: CommonDef.h:188
static const Int MRG_MAX_NUM_CANDS
MERGE.
Definition: CommonDef.h:131
const TComSPSRExt & getSpsRangeExtension() const
Definition: TComSlice.h:941
SChar * getCrossComponentPredictionAlpha(ComponentID compID)
Definition: TComDataCU.h:242
static Void crossComponentPrediction(TComTU &rTu, const ComponentID compID, const Pel *piResiL, const Pel *piResiC, Pel *piResiT, const Int width, const Int height, const Int strideL, const Int strideC, const Int strideT, const Bool reverse)
UChar * getTransformIdx()
Definition: TComDataCU.h:277
#define NULL
Definition: CommonDef.h:107
UChar getQtRootCbf(UInt uiIdx) const
class for motion vector with reference index
static UInt getComponentScaleY(const ComponentID id, const ChromaFormat fmt)
Bool getUseChromaQpAdj() const
Definition: TComSlice.h:1364
ChromaFormat GetChromaFormat() const
Definition: TComTU.h:124
Bool isLastColumnCTUInTile() const
Void motionCompensation(TComDataCU *pcCU, TComYuv *pcYuvPred, RefPicList eRefPicList=REF_PIC_LIST_X, Int iPartIdx=-1)
Void xReconInter(TComDataCU *pcCU, UInt uiDepth)
Definition: TDecCu.cpp:433
unsigned int UInt
Definition: TypeDef.h:212
SChar * getPredictionMode()
Definition: TComDataCU.h:237
UInt getNumPartitionsInCtu() const
Definition: TComPic.h:130
static UInt getComponentScaleX(const ComponentID id, const ChromaFormat fmt)
Void decodePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Short Pel
pixel type
Definition: TypeDef.h:249
static Bool filteringIntraReferenceSamples(const ComponentID compID, UInt uiDirMode, UInt uiTuChWidth, UInt uiTuChHeight, const ChromaFormat chFmt, const Bool intraReferenceSmoothingDisabled)
Void xIntraRecBlk(TComYuv *pcRecoYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, const ComponentID component, TComTU &rTu)
Definition: TDecCu.cpp:483
UInt getMaxCUHeight() const
Definition: TComSlice.h:859
Void decodePredInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU *pcSubCU)
UInt getStride(const ComponentID id) const
Definition: TComYuv.h:199
Void copyToPicYuv(TComPicYuv *pcPicYuvDst, const UInt ctuRsAddr, const UInt uiAbsZorderIdx, const UInt uiPartDepth=0, const UInt uiPartIdx=0) const
Definition: TComYuv.cpp:106
UInt GetTransformDepthRel() const
Definition: TComTU.h:108
Int getNumberValidComponents() const
Definition: TComPic.h:140
Void xReconPCM(TComDataCU *pcCU, UInt uiDepth)
Definition: TDecCu.cpp:812
T ClipBD(const T x, const Int bitDepth)
Definition: CommonDef.h:253
Void copyInterPredInfoFrom(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList)
Definition: TComDataCU.cpp:782
Void xDecompressCU(TComDataCU *pCtu, UInt uiAbsPartIdx, UInt uiDepth)
Definition: TDecCu.cpp:359
UChar getCbf(UInt uiIdx, ComponentID eType) const
Definition: TComDataCU.h:307
UChar * getMergeIndex()
Definition: TComDataCU.h:330
QP struct.
Definition: TComTrQuant.h:80
Bool nextSection(const TComTU &parent)
Definition: TComTU.cpp:178
Void setIsChromaQpAdjCoded(Bool b)
Definition: TDecCu.h:122
Bool getTransquantBypassEnabledFlag() const
Definition: TComSlice.h:1142
Int getNumRefIdx(RefPicList e) const
Definition: TComSlice.h:1370
Bool getdQPFlag()
Definition: TDecCu.h:119
UInt getDiffCuChromaQpOffsetDepth() const
Definition: TComSlice.h:1006
UInt getZorderIdxInCtu() const
Definition: TComDataCU.h:206
Bool getTMctsCheck() const
Void setInterDirSubParts(UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
TComPicYuv * getPicYuvRec()
Definition: TComPic.h:120
UInt GetAbsPartIdxTU() const
Definition: TComTU.h:119
Void setOutsideCUPart(UInt uiAbsPartIdx, UInt uiDepth)
Definition: TComDataCU.cpp:684
UInt getMaxTotalCUDepth() const
Definition: TComSlice.h:861
Void setChromaQpAdjSubParts(UChar val, Int absPartIdx, Int depth)
PartSize
supported partition shape
Definition: TypeDef.h:348
Bool * getIPCMFlag()
Definition: TComDataCU.h:354
static Bool enable4ChromaPUsInIntraNxNCU(const ChromaFormat chFmt)
TComDataCU ** m_ppcCU
CU data array.
Definition: TDecCu.h:63
UChar * getIntraDir(const ChannelType channelType) const
Definition: TComDataCU.h:342
Bool checkTMctsMvp(TComDataCU *pcCU, Int partIdx=-1)
CU decoder class (header)
UInt getMaxNumMergeCand() const
Definition: TComSlice.h:1465
symmetric motion partition, 2Nx2N
Definition: TypeDef.h:350
general YUV buffer class
Definition: TComYuv.h:54
Void predIntraAng(const ComponentID compID, UInt uiDirMode, Pel *piOrg, UInt uiOrgStride, Pel *piPred, UInt uiStride, TComTU &rTu, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM=false)
bool Bool
Definition: TypeDef.h:204
Bool isIntra(UInt uiPartIdx) const
Definition: TComDataCU.h:450
Void setAllMvField(TComMvField const &mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
TDecCu()
Definition: TDecCu.cpp:49
UInt getComponentScaleX(const ComponentID id) const
Definition: TComYuv.h:204
Void initRasterToPelXY(UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth)
Definition: TComRom.cpp:324
Void decodeIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void xCopyToPic(TComDataCU *pcCU, TComPic *pcPic, UInt uiZorderIdx, UInt uiDepth)
Definition: TDecCu.cpp:751
Void xDecodePCMTexture(TComDataCU *pcCU, const UInt uiPartIdx, const Pel *piPCM, Pel *piReco, const UInt uiStride, const UInt uiWidth, const UInt uiHeight, const ComponentID compID)
Definition: TDecCu.cpp:787
PPS class.
Definition: TComSlice.h:1034
Void setdQPFlag(Bool b)
Definition: TDecCu.h:120
UInt & getCtuRsAddr()
Definition: TComDataCU.h:204
UInt getPicHeightInLumaSamples() const
Definition: TComSlice.h:836
Void addClip(const TComYuv *pcYuvSrc0, const TComYuv *pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize, const BitDepths &clipBitDepths)
Definition: TComYuv.cpp:282
Void xDecodeInterTexture(TComDataCU *pcCU, UInt uiDepth)
Definition: TDecCu.cpp:760
UInt getComponentScaleY(const ComponentID id) const
Definition: TComYuv.h:205
Void create(const UInt iWidth, const UInt iHeight, const ChromaFormat chromaFormatIDC)
Create YUV buffer.
Definition: TComYuv.cpp:64
UInt getCUPelY() const
Definition: TComDataCU.h:208
static ChannelType toChannelType(const ComponentID id)
Void xReconIntraQT(TComDataCU *pcCU, UInt uiDepth)
Definition: TDecCu.cpp:679
Void decodeCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Definition: TDecEntropy.cpp:64
Void initRasterToZscan(UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth)
Definition: TComRom.cpp:310
Bool m_IsChromaQpAdjCoded
Definition: TDecCu.h:74
reference list 0
Definition: TypeDef.h:372
Int getBitDepth(ChannelType type) const
Definition: TComSlice.h:894
Int TCoeff
transform coefficient
Definition: TypeDef.h:250
Bool getUseDQP() const
Definition: TComSlice.h:1099
Pel * getAddr(const ComponentID id)
Definition: TComYuv.h:150
RefPicList
reference list index
Definition: TypeDef.h:370
Void xDecodeCU(TComDataCU *const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment)
decode CU block recursively
Definition: TDecCu.cpp:189
TComPicSym * getPicSym()
Definition: TComPic.h:111
UInt getMaxCuDQPDepth() const
Definition: TComSlice.h:1107
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Definition: TypeDef.h:292
UInt getCoefficientOffset(const ComponentID compID) const
Definition: TComTU.h:94
intra-prediction mode
Definition: TypeDef.h:365
unsigned char UChar
Definition: TypeDef.h:208
const TComRectangle & getRect(const ComponentID compID) const
Definition: TComTU.h:96
const BitDepths & getBitDepths() const
Definition: TComSlice.h:900
Bool isSkipped(UInt uiPartIdx) const
returns true, if the partiton is skipped
UInt g_auiZscanToRaster[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Definition: TComRom.cpp:284
const TComPPS * getPPS() const
Definition: TComSlice.h:1332
UInt getPicWidthInLumaSamples() const
Definition: TComSlice.h:834
Void setQPSubParts(Int qp, UInt uiAbsPartIdx, UInt uiDepth)
Void copySubCU(TComDataCU *pcCU, UInt uiPartUnitIdx)
Definition: TComDataCU.cpp:700
UInt getCUPelX() const
Definition: TComDataCU.h:207
#define DEBUG_STRING_PASS_INTO(name)
Definition: TypeDef.h:180
TComPrediction * m_pcPrediction
Definition: TDecCu.h:67
ChromaFormat getChromaFormat() const
Definition: TComPic.h:139
Bool getIntraSmoothingDisabledFlag() const
Definition: TComSlice.h:726
Bool isIntra() const
Definition: TComSlice.h:1423
TComDataCU * getCU()
Definition: TComTU.h:126
SChar getCodedQP() const
Definition: TComDataCU.h:266
entropy decoder class
Definition: TDecEntropy.h:117
reference list 1
Definition: TypeDef.h:373
UChar * getHeight()
Definition: TComDataCU.h:252
Void destroy()
destroy internal buffers
Definition: TDecCu.cpp:119
Bool ProcessComponentSection(const ComponentID compID) const
Definition: TComTU.h:99
SChar getCodedChromaQpAdj() const
Definition: TComDataCU.h:273
const TComSPS & getSPS() const
Definition: TComPicSym.h:163
Void invTransformNxN(TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, TCoeff *pcCoeff, const QpParam &cQP)
Int getLog2DiffMaxMinCodingBlockSize() const
Definition: TComSlice.h:853
Bool getIsChromaQpAdjCoded()
Definition: TDecCu.h:121
TComPic * getPic()
Definition: TComDataCU.h:200
TDecConformanceCheck * m_pConformanceCheck
Definition: TDecCu.h:70
Void setAllMvd(TComMv const &rcMvd, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
Definition: TComDataCU.cpp:109
Definition: TComTU.h:48
TDecEntropy * m_pcEntropyDecoder
Definition: TDecCu.h:68
const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]
Definition: TComRom.cpp:564
Void flagTMctsError(const char *error)
Void decodeCoeff(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &bCodeDQP, Bool &isChromaQpAdjCoded)
decode coefficients
TComYuv ** m_ppcYuvReco
array of prediction &amp; reconstruction buffer
Definition: TDecCu.h:62
transform and quantization class
Definition: TComTrQuant.h:98
Pel * getAddr(const ComponentID ch)
Definition: TComPicYuv.h:139
Void initZscanToRaster(Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt *&rpuiCurrIdx)
Definition: TComRom.cpp:291
Void create(UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC)
create internal buffers
Definition: TDecCu.cpp:80
TComCUMvField * getCUMvField(RefPicList e)
Definition: TComDataCU.h:297
UChar * getWidth()
Definition: TComDataCU.h:248
TCoeff * getCoeff(ComponentID component)
Definition: TComDataCU.h:300
Void destroy()
Definition: TComDataCU.cpp:208
Bool isLastSubCUOfCtu(const UInt absPartIdx) const
Definition: TComDataCU.cpp:393
int Int
Definition: TypeDef.h:211
basic motion vector class
Definition: TComMv.h:51
static Bool isChroma(const ComponentID id)
UInt getPCMBitDepth(ChannelType type) const
Definition: TComSlice.h:915
Void initIntraPatternChType(TComTU &rTu, const ComponentID compID, const Bool bFilterRefSamples)
set parameters from CU data for accessing intra data
UInt & getTotalNumPart()
Definition: TComDataCU.h:482
ComponentID
Definition: TypeDef.h:308
PredMode
supported prediction type
Definition: TypeDef.h:362
Bool m_bDecodeDQP
Definition: TDecCu.h:73
Void decompressCtu(TComDataCU *pCtu)
reconstruct Ctu information
Definition: TDecCu.cpp:162
SChar getRefQP(UInt uiCurrAbsIdxInCtu) const
Void decodeMergeIndex(TComDataCU *pcSubCU, UInt uiPartIdx, UInt uiPartAddr, UInt uiDepth)
Definition: TDecEntropy.cpp:90
Void invRecurTransformNxN(const ComponentID compID, TComYuv *pResidual, TComTU &rTu)
inter-prediction mode
Definition: TypeDef.h:364
Pel * getPCMSample(ComponentID component)
Definition: TComDataCU.h:305
Void decodeTerminatingBit(UInt &ruiIsLast)
Definition: TDecEntropy.h:150
UInt g_auiRasterToPelX[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Definition: TComRom.cpp:286
Void setMVPIdxSubParts(Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Bool xDecodeSliceEnd(TComDataCU *pcCU, UInt uiAbsPartIdx)
decode end-of-slice flag
Definition: TDecCu.cpp:172
static UInt getNumberValidComponents(const ChromaFormat fmt)
Void init(TDecEntropy *pcEntropyDecoder, TComTrQuant *pcTrQuant, TComPrediction *pcPrediction, TDecConformanceCheck *pConformanceCheck)
initialize access channels
Definition: TDecCu.cpp:61
slice header class
Definition: TComSlice.h:1225
Void decodePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
TComYuv ** m_ppcYuvResi
array of residual buffer
Definition: TDecCu.h:61
Void copyPartToPartYuv(TComYuv *pcYuvDst, const UInt uiPartIdx, const UInt uiWidth, const UInt uiHeight) const
Definition: TComYuv.cpp:224
Void clear()
clear YUV buffer
Definition: TComYuv.cpp:92
#define DEBUG_STRING_OUTPUT(os, name)
Definition: TypeDef.h:185
#define DEBUG_STRING_NEW(name)
Definition: TypeDef.h:184
Void printBlockToStream(std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth)
Definition: Debug.cpp:422
#define DEBUG_STRING_CHANNEL_CONDITION(compID)
Definition: TypeDef.h:188
UInt g_auiRasterToPelY[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Definition: TComRom.cpp:287
static Bool isLuma(const ComponentID id)
UInt getMaxCUWidth() const
Definition: TComSlice.h:857
TComSlice * getSlice()
Definition: TComDataCU.h:202
const TComSPS * getSPS() const
Definition: TComSlice.h:1329
SPS class.
Definition: TComSlice.h:740
virtual ~TDecCu()
Definition: TDecCu.cpp:56