HEVC Test Model (HM)  HM-16.3
TAppDecTop.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 <list>
39 #include <vector>
40 #include <stdio.h>
41 #include <fcntl.h>
42 #include <assert.h>
43 
44 #include "TAppDecTop.h"
45 #include "TLibDecoder/AnnexBread.h"
46 #include "TLibDecoder/NALread.h"
47 #if RExt__DECODER_DEBUG_BIT_STATISTICS
49 #endif
50 
53 
54 // ====================================================================================================================
55 // Constructor / destructor / initialization / destroy
56 // ====================================================================================================================
57 
59 : m_iPOCLastDisplay(-MAX_INT)
60 {
61 }
62 
64 {
65 }
66 
68 {
70  {
71  free (m_pchBitstreamFile);
73  }
74  if (m_pchReconFile)
75  {
76  free (m_pchReconFile);
78  }
79 }
80 
81 // ====================================================================================================================
82 // Public member functions
83 // ====================================================================================================================
84 
94 {
95  Int poc;
96  TComList<TComPic*>* pcListPic = NULL;
97 
98  ifstream bitstreamFile(m_pchBitstreamFile, ifstream::in | ifstream::binary);
99  if (!bitstreamFile)
100  {
101  fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_pchBitstreamFile);
102  exit(EXIT_FAILURE);
103  }
104 
105  InputByteStream bytestream(bitstreamFile);
106 
108  {
109  m_seiMessageFileStream.open(m_outputDecodedSEIMessagesFilename.c_str(), std::ios::out);
110  if (!m_seiMessageFileStream.is_open() || !m_seiMessageFileStream.good())
111  {
112  fprintf(stderr, "\nUnable to open file `%s' for writing decoded SEI messages\n", m_outputDecodedSEIMessagesFilename.c_str());
113  exit(EXIT_FAILURE);
114  }
115  }
116 
117  // create & initialize internal classes
118  xCreateDecLib();
119  xInitDecLib ();
120  m_iPOCLastDisplay += m_iSkipFrame; // set the last displayed POC correctly for skip forward.
121 
122  // main decoder loop
123  Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen)
124  Bool loopFiltered = false;
125 
126  while (!!bitstreamFile)
127  {
128  /* location serves to work around a design fault in the decoder, whereby
129  * the process of reading a new slice that is the first slice of a new frame
130  * requires the TDecTop::decode() method to be called again with the same
131  * nal unit. */
132 #if RExt__DECODER_DEBUG_BIT_STATISTICS
134  streampos location = bitstreamFile.tellg() - streampos(bytestream.GetNumBufferedBytes());
135 #else
136  streampos location = bitstreamFile.tellg();
137 #endif
138  AnnexBStats stats = AnnexBStats();
139 
140  vector<uint8_t> nalUnit;
141  InputNALUnit nalu;
142  byteStreamNALUnit(bytestream, nalUnit, stats);
143 
144  // call actual decoding function
145  Bool bNewPicture = false;
146  if (nalUnit.empty())
147  {
148  /* this can happen if the following occur:
149  * - empty input file
150  * - two back-to-back start_code_prefixes
151  * - start_code_prefix immediately followed by EOF
152  */
153  fprintf(stderr, "Warning: Attempt to decode an empty NAL unit\n");
154  }
155  else
156  {
157  read(nalu, nalUnit);
159  {
160  bNewPicture = false;
161  }
162  else
163  {
164  bNewPicture = m_cTDecTop.decode(nalu, m_iSkipFrame, m_iPOCLastDisplay);
165  if (bNewPicture)
166  {
167  bitstreamFile.clear();
168  /* location points to the current nalunit payload[1] due to the
169  * need for the annexB parser to read three extra bytes.
170  * [1] except for the first NAL unit in the file
171  * (but bNewPicture doesn't happen then) */
172 #if RExt__DECODER_DEBUG_BIT_STATISTICS
173  bitstreamFile.seekg(location);
174  bytestream.reset();
176 #else
177  bitstreamFile.seekg(location-streamoff(3));
178  bytestream.reset();
179 #endif
180  }
181  }
182  }
183 
184  if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) &&
186  {
187  if (!loopFiltered || bitstreamFile)
188  {
189  m_cTDecTop.executeLoopFilters(poc, pcListPic);
190  }
191  loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
192  if (nalu.m_nalUnitType == NAL_UNIT_EOS)
193  {
195  }
196  }
197  else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
199  {
201  }
202 
203  if( pcListPic )
204  {
205  if ( m_pchReconFile && !openedReconFile )
206  {
207  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
208  {
209  if (m_outputBitDepth[channelType] == 0)
210  {
211  m_outputBitDepth[channelType] = g_bitDepth[channelType];
212  }
213  }
214 
216  openedReconFile = true;
217  }
218  // write reconstruction to file
219  if( bNewPicture )
220  {
221  xWriteOutput( pcListPic, nalu.m_temporalId );
222  }
224  {
225  m_cTDecTop.checkNoOutputPriorPics( pcListPic );
227  }
228  if ( bNewPicture &&
234  {
235  xFlushOutput( pcListPic );
236  }
237  if (nalu.m_nalUnitType == NAL_UNIT_EOS)
238  {
239  xWriteOutput( pcListPic, nalu.m_temporalId );
241  }
242  // write reconstruction to file -- for additional bumping as defined in C.5.2.3
244  {
245  xWriteOutput( pcListPic, nalu.m_temporalId );
246  }
247  }
248  }
249 
250  xFlushOutput( pcListPic );
251  // delete buffers
253 
254  // destroy internal classes
255  xDestroyDecLib();
256 }
257 
258 // ====================================================================================================================
259 // Protected member functions
260 // ====================================================================================================================
261 
263 {
264  // create decoder class
265  m_cTDecTop.create();
266 }
267 
269 {
270  if ( m_pchReconFile )
271  {
272  m_cTVideoIOYuvReconFile. close();
273  }
274 
275  // destroy decoder class
277 }
278 
280 {
281  // initialize decoder class
282  m_cTDecTop.init();
284 #if O0043_BEST_EFFORT_DECODING
285  m_cTDecTop.setForceDecodeBitDepth(m_forceDecodeBitDepth);
286 #endif
288  {
289  std::ostream &os=m_seiMessageFileStream.is_open() ? m_seiMessageFileStream : std::cout;
291  }
292 }
293 
299 {
300  if (pcListPic->empty())
301  {
302  return;
303  }
304 
305  TComList<TComPic*>::iterator iterPic = pcListPic->begin();
306  Int numPicsNotYetDisplayed = 0;
307  Int dpbFullness = 0;
308  const TComSPS* activeSPS = &(pcListPic->front()->getPicSym()->getSPS());
309  UInt numReorderPicsHighestTid;
310  UInt maxDecPicBufferingHighestTid;
311  UInt maxNrSublayers = activeSPS->getMaxTLayers();
312 
313  if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers)
314  {
315  numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1);
316  maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(maxNrSublayers-1);
317  }
318  else
319  {
320  numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer);
321  maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer);
322  }
323 
324  while (iterPic != pcListPic->end())
325  {
326  TComPic* pcPic = *(iterPic);
327  if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay)
328  {
329  numPicsNotYetDisplayed++;
330  dpbFullness++;
331  }
332  else if(pcPic->getSlice( 0 )->isReferenced())
333  {
334  dpbFullness++;
335  }
336  iterPic++;
337  }
338 
339  iterPic = pcListPic->begin();
340 
341  if (numPicsNotYetDisplayed>2)
342  {
343  iterPic++;
344  }
345 
346  TComPic* pcPic = *(iterPic);
347  if (numPicsNotYetDisplayed>2 && pcPic->isField()) //Field Decoding
348  {
349  TComList<TComPic*>::iterator endPic = pcListPic->end();
350  endPic--;
351  iterPic = pcListPic->begin();
352  while (iterPic != endPic)
353  {
354  TComPic* pcPicTop = *(iterPic);
355  iterPic++;
356  TComPic* pcPicBottom = *(iterPic);
357 
358  if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
359  (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
360  (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&
361  (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0))
362  {
363  // write to file
364  numPicsNotYetDisplayed = numPicsNotYetDisplayed-2;
365  if ( m_pchReconFile )
366  {
367  const Window &conf = pcPicTop->getConformanceWindow();
368  const Window defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
369  const Bool isTff = pcPicTop->isTopField();
370 
371  Bool display = true;
373  {
374  SEIMessages noDisplay = getSeisByType(pcPic->getSEIs(), SEI::NO_DISPLAY );
375  const SEINoDisplay *nd = ( noDisplay.size() > 0 ) ? (SEINoDisplay*) *(noDisplay.begin()) : NULL;
376  if( (nd != NULL) && nd->m_noDisplay )
377  {
378  display = false;
379  }
380  }
381 
382  if (display)
383  {
384  m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
386  conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
387  conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
388  conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
390  }
391  }
392 
393  // update POC of display order
394  m_iPOCLastDisplay = pcPicBottom->getPOC();
395 
396  // erase non-referenced picture in the reference picture list after display
397  if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
398  {
399 #if !DYN_REF_FREE
400  pcPicTop->setReconMark(false);
401 
402  // mark it should be extended later
403  pcPicTop->getPicYuvRec()->setBorderExtension( false );
404 
405 #else
406  pcPicTop->destroy();
407  pcListPic->erase( iterPic );
408  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
409  continue;
410 #endif
411  }
412  if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
413  {
414 #if !DYN_REF_FREE
415  pcPicBottom->setReconMark(false);
416 
417  // mark it should be extended later
418  pcPicBottom->getPicYuvRec()->setBorderExtension( false );
419 
420 #else
421  pcPicBottom->destroy();
422  pcListPic->erase( iterPic );
423  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
424  continue;
425 #endif
426  }
427  pcPicTop->setOutputMark(false);
428  pcPicBottom->setOutputMark(false);
429  }
430  }
431  }
432  else if (!pcPic->isField()) //Frame Decoding
433  {
434  iterPic = pcListPic->begin();
435 
436  while (iterPic != pcListPic->end())
437  {
438  pcPic = *(iterPic);
439 
440  if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
441  (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
442  {
443  // write to file
444  numPicsNotYetDisplayed--;
445  if(pcPic->getSlice(0)->isReferenced() == false)
446  {
447  dpbFullness--;
448  }
449 
450  if ( m_pchReconFile )
451  {
452  const Window &conf = pcPic->getConformanceWindow();
453  const Window defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
454 
457  conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
458  conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
459  conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
460  conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
461  }
462 
463  // update POC of display order
464  m_iPOCLastDisplay = pcPic->getPOC();
465 
466  // erase non-referenced picture in the reference picture list after display
467  if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
468  {
469 #if !DYN_REF_FREE
470  pcPic->setReconMark(false);
471 
472  // mark it should be extended later
473  pcPic->getPicYuvRec()->setBorderExtension( false );
474 
475 #else
476  pcPic->destroy();
477  pcListPic->erase( iterPic );
478  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
479  continue;
480 #endif
481  }
482  pcPic->setOutputMark(false);
483  }
484 
485  iterPic++;
486  }
487  }
488 }
489 
494 {
495  if(!pcListPic || pcListPic->empty())
496  {
497  return;
498  }
499  TComList<TComPic*>::iterator iterPic = pcListPic->begin();
500 
501  iterPic = pcListPic->begin();
502  TComPic* pcPic = *(iterPic);
503 
504  if (pcPic->isField()) //Field Decoding
505  {
506  TComList<TComPic*>::iterator endPic = pcListPic->end();
507  endPic--;
508  TComPic *pcPicTop, *pcPicBottom = NULL;
509  while (iterPic != endPic)
510  {
511  pcPicTop = *(iterPic);
512  iterPic++;
513  pcPicBottom = *(iterPic);
514 
515  if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) )
516  {
517  // write to file
518  if ( m_pchReconFile )
519  {
520  const Window &conf = pcPicTop->getConformanceWindow();
521  const Window defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
522  const Bool isTff = pcPicTop->isTopField();
523  m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
525  conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
526  conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
527  conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
529  }
530 
531  // update POC of display order
532  m_iPOCLastDisplay = pcPicBottom->getPOC();
533 
534  // erase non-referenced picture in the reference picture list after display
535  if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
536  {
537 #if !DYN_REF_FREE
538  pcPicTop->setReconMark(false);
539 
540  // mark it should be extended later
541  pcPicTop->getPicYuvRec()->setBorderExtension( false );
542 
543 #else
544  pcPicTop->destroy();
545  pcListPic->erase( iterPic );
546  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
547  continue;
548 #endif
549  }
550  if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
551  {
552 #if !DYN_REF_FREE
553  pcPicBottom->setReconMark(false);
554 
555  // mark it should be extended later
556  pcPicBottom->getPicYuvRec()->setBorderExtension( false );
557 
558 #else
559  pcPicBottom->destroy();
560  pcListPic->erase( iterPic );
561  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
562  continue;
563 #endif
564  }
565  pcPicTop->setOutputMark(false);
566  pcPicBottom->setOutputMark(false);
567 
568 #if !DYN_REF_FREE
569  if(pcPicTop)
570  {
571  pcPicTop->destroy();
572  delete pcPicTop;
573  pcPicTop = NULL;
574  }
575 #endif
576  }
577  }
578  if(pcPicBottom)
579  {
580  pcPicBottom->destroy();
581  delete pcPicBottom;
582  pcPicBottom = NULL;
583  }
584  }
585  else //Frame decoding
586  {
587  while (iterPic != pcListPic->end())
588  {
589  pcPic = *(iterPic);
590 
591  if ( pcPic->getOutputMark() )
592  {
593  // write to file
594  if ( m_pchReconFile )
595  {
596  const Window &conf = pcPic->getConformanceWindow();
597  const Window defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
598 
601  conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
602  conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
603  conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
604  conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
605  }
606 
607  // update POC of display order
608  m_iPOCLastDisplay = pcPic->getPOC();
609 
610  // erase non-referenced picture in the reference picture list after display
611  if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
612  {
613  #if !DYN_REF_FREE
614  pcPic->setReconMark(false);
615 
616  // mark it should be extended later
617  pcPic->getPicYuvRec()->setBorderExtension( false );
618 
619  #else
620  pcPic->destroy();
621  pcListPic->erase( iterPic );
622  iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
623  continue;
624  #endif
625  }
626  pcPic->setOutputMark(false);
627  }
628  #if !DYN_REF_FREE
629  if(pcPic != NULL)
630  {
631  pcPic->destroy();
632  delete pcPic;
633  pcPic = NULL;
634  }
635  #endif
636  iterPic++;
637  }
638  }
639  pcListPic->clear();
641 }
642 
646 {
647  if ( m_targetDecLayerIdSet.size() == 0 ) // By default, the set is empty, meaning all LayerIds are allowed
648  {
649  return true;
650  }
651  for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++)
652  {
653  if ( nalu->m_nuhLayerId == (*it) )
654  {
655  return true;
656  }
657  }
658  return false;
659 }
660 
virtual Void destroy()
Definition: TComPic.cpp:91
Void xInitDecLib()
initialize decoder class
Definition: TAppDecTop.cpp:279
Void executeLoopFilters(Int &poc, TComList< TComPic * > *&rpcListPic)
Definition: TDecTop.cpp:179
Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]
bit depth used for writing output
Definition: TAppDecCfg.h:62
Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream)
Definition: TDecTop.h:137
Int getWindowTopOffset() const
Definition: TComSlice.h:536
Void create()
create internal members
Definition: TAppDecTop.cpp:63
Bool isTopField()
Definition: TComPic.h:153
Bool getFirstSliceInSequence()
Definition: TDecTop.h:132
#define MAX_INT
max. value of signed 32-bit integer
Definition: CommonDef.h:116
Void open(Char *pchFile, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE])
open or create file
TVideoIOYuv m_cTVideoIOYuvReconFile
reconstruction YUV class
Definition: TAppDecTop.h:64
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
void Void
Definition: TypeDef.h:285
Char * m_pchReconFile
output reconstruction file name
Definition: TAppDecCfg.h:60
Int getWindowBottomOffset() const
Definition: TComSlice.h:538
reading funtionality for NAL units
Int getWindowLeftOffset() const
Definition: TComSlice.h:532
Void init()
Definition: TDecTop.cpp:101
SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
output a selection of SEI messages by payload type. Ownership stays in original message list...
Definition: SEI.cpp:44
#define NULL
Definition: CommonDef.h:100
TComSlice * getSlice(Int i)
Definition: TComPic.h:103
Bool getNoOutputPriorPicsFlag()
Definition: TDecTop.h:129
unsigned int UInt
Definition: TypeDef.h:297
Int m_iMaxTemporalLayer
maximum temporal layer to be decoded
Definition: TAppDecCfg.h:65
InputColourSpaceConversion m_outputColourSpaceConvert
Definition: TAppDecCfg.h:63
Void setFirstSliceInSequence(bool val)
Definition: TDecTop.h:133
NalUnitType m_nalUnitType
nal_unit_type
Definition: NAL.h:49
Bool isReferenced() const
Definition: TComSlice.h:1368
UInt getMaxDecPicBuffering(UInt tlayer) const
Definition: TComSlice.h:929
Bool isNaluWithinTargetDecLayerIdSet(InputNALUnit *nalu)
check whether given Nalu is within targetDecLayerIdSet
Definition: TAppDecTop.cpp:645
const Window & getConformanceWindow() const
Definition: TComPic.h:143
TComPicYuv * getPicYuvRec()
Definition: TComPic.h:109
Void xFlushOutput(TComList< TComPic * > *pcListPic)
flush all remaining decoded pictures to file
Definition: TAppDecTop.cpp:493
Decoder application class (header)
Window getDefDisplayWindow() const
Definition: TComPic.h:144
Void read(InputNALUnit &nalu, vector< uint8_t > &nalUnitBuf)
Definition: NALread.cpp:147
Void setFirstSliceInPicture(bool val)
Definition: TDecTop.h:131
Bool write(TComPicYuv *pPicYuv, const InputColourSpaceConversion ipCSC, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, ChromaFormat fileFormat=NUM_CHROMA_FORMAT)
write one YUV frame with padding parameter
bool Bool
Definition: TypeDef.h:286
reading functions for Annex B byte streams
Void setDecodedPictureHashSEIEnabled(Int enabled)
Definition: TDecTop.h:119
TDecTop m_cTDecTop
decoder class
Definition: TAppDecTop.h:63
Void deletePicBuffer()
Definition: TDecTop.cpp:110
Void setNoOutputPriorPicsFlag(Bool val)
Definition: TDecTop.h:130
UInt m_nuhLayerId
nuh_layer_id
Definition: NAL.h:51
Void decode()
main decoding function
Definition: TAppDecTop.cpp:93
std::string m_outputDecodedSEIMessagesFilename
filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details...
Definition: TAppDecCfg.h:73
Int getPOC() const
Definition: TComPic.h:104
Void setOutputMark(Bool b)
Definition: TComPic.h:133
Int m_iPOCLastDisplay
last POC in display order
Definition: TAppDecTop.h:67
Void xWriteOutput(TComList< TComPic * > *pcListPic, UInt tId)
write YUV to file
Definition: TAppDecTop.cpp:298
Char * m_pchBitstreamFile
input bitstream file name
Definition: TAppDecCfg.h:59
Int g_bitDepth[MAX_NUM_CHANNEL_TYPE]
Definition: TComRom.cpp:548
Int m_iSkipFrame
counter for frames prior to the random access point to skip
Definition: TAppDecCfg.h:61
Void destroy()
Definition: TDecTop.cpp:91
Bool m_decodedNoDisplaySEIEnabled
Enable(true)/disable(false) writing only pictures that get displayed based on the no display SEI mess...
Definition: TAppDecCfg.h:67
Void setReconMark(Bool b)
Definition: TComPic.h:131
std::list< SEI * > SEIMessages
Definition: SEI.h:479
Void xDestroyDecLib()
destroy internal classes
Definition: TAppDecTop.cpp:268
int Int
Definition: TypeDef.h:296
UInt getMaxTLayers() const
Definition: TComSlice.h:910
Int m_respectDefDispWindow
Only output content inside the default display window.
Definition: TAppDecCfg.h:69
std::ofstream m_seiMessageFileStream
Used for outputing SEI messages.
Definition: TAppDecTop.h:68
static const TComCodingStatisticsData & GetStatistics()
Int getWindowRightOffset() const
Definition: TComSlice.h:534
Bool getReconMark() const
Definition: TComPic.h:132
SEIMessages & getSEIs()
Definition: TComPic.h:163
Void setBorderExtension(Bool b)
Definition: TComPicYuv.h:155
Void destroy()
destroy internal members
Definition: TAppDecTop.cpp:67
Bool getOutputMark() const
Definition: TComPic.h:134
UInt m_temporalId
temporal_id
Definition: NAL.h:50
Bool byteStreamNALUnit(InputByteStream &bs, vector< uint8_t > &nalUnit, AnnexBStats &stats)
Definition: AnnexBread.cpp:182
Bool decode(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay)
Definition: TDecTop.cpp:684
static Void SetStatistics(const TComCodingStatisticsData &src)
std::vector< Int > m_targetDecLayerIdSet
set of LayerIds to be included in the sub-bitstream extraction process.
Definition: TAppDecCfg.h:68
Bool isField()
Definition: TComPic.h:155
Void create()
Definition: TDecTop.cpp:84
Void checkNoOutputPriorPics(TComList< TComPic * > *rpcListPic)
Definition: TDecTop.cpp:202
Int m_decodedPictureHashSEIEnabled
Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message.
Definition: TAppDecCfg.h:66
Void xCreateDecLib()
create internal classes
Definition: TAppDecTop.cpp:262
Int getNumReorderPics(UInt tlayer) const
Definition: TComSlice.h:869
SPS class.
Definition: TComSlice.h:722