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