HEVC Test Model (HM)  HM-16.3
SEI.h
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 
34 #ifndef __SEI__
35 #define __SEI__
36 
37 #pragma once
38 #include <list>
39 #include <vector>
40 #include <cstring>
41 
42 #include "TypeDef.h"
43 #include "libmd5/MD5.h"
44 
47 class TComSPS;
48 
52 class SEI
53 {
54 public:
56  {
80  NO_DISPLAY = 135,
81  TIME_CODE = 136,
87  };
88 
89  SEI() {}
90  virtual ~SEI() {}
91 
93 
94  virtual PayloadType payloadType() const = 0;
95 };
96 
97 static const UInt ISO_IEC_11578_LEN=16;
98 
100 {
101 public:
103 
105  : userData(0)
106  {}
107 
109  {
110  delete userData;
111  }
112 
116 };
117 
119 {
120 public:
122 
125 
126  enum Method
127  {
132  } method;
133 
135 };
136 
138 {
139 public:
141 
143  : activeVPSId (0)
144  , m_selfContainedCvsFlag (false)
146  , numSpsIdsMinus1 (0)
147  {}
149 
154  std::vector<Int> activeSeqParameterSetId;
155 };
156 
157 class SEIBufferingPeriod : public SEI
158 {
159 public:
161 
164  , m_rapCpbParamsPresentFlag (false)
165  , m_cpbDelayOffset (0)
166  , m_dpbDelayOffset (0)
167  {
172  }
173  virtual ~SEIBufferingPeriod() {}
174 
185 };
186 class SEIPictureTiming : public SEI
187 {
188 public:
190 
192  : m_picStruct (0)
193  , m_sourceScanType (0)
194  , m_duplicateFlag (false)
198  {}
200  {
201  if( m_numNalusInDuMinus1 != NULL )
202  {
203  delete m_numNalusInDuMinus1;
204  }
206  {
208  }
209  }
210 
214 
223 };
224 
225 class SEIDecodingUnitInfo : public SEI
226 {
227 public:
229 
231  : m_decodingUnitIdx(0)
235  {}
236  virtual ~SEIDecodingUnitInfo() {}
241 };
242 
243 class SEIRecoveryPoint : public SEI
244 {
245 public:
247 
249  virtual ~SEIRecoveryPoint() {}
250 
254 };
255 
256 class SEIFramePacking : public SEI
257 {
258 public:
260 
262  virtual ~SEIFramePacking() {}
263 
282 };
283 
285 {
286 public:
288 
291 
295 };
296 
298 {
299 public:
301 
303  : cancelFlag(true)
304  , persistenceFlag(0)
305  , extensionFlag(false)
306  {}
308 
312 
316 };
317 
319 {
320 public:
322 
324  : tl0Idx(0)
325  , rapIdx(0)
326  {}
328 
331 };
332 
334 {
335 public:
337 
340  {}
342 
344 };
345 
346 class SEINoDisplay : public SEI
347 {
348 public:
349  PayloadType payloadType() const { return NO_DISPLAY; }
350 
352  : m_noDisplay(false)
353  {}
354  virtual ~SEINoDisplay() {}
355 
357 };
358 
359 class SEISOPDescription : public SEI
360 {
361 public:
363 
365  virtual ~SEISOPDescription() {}
366 
369 
374 };
375 
376 class SEIToneMappingInfo : public SEI
377 {
378 public:
381  virtual ~SEIToneMappingInfo() {}
382 
393  std::vector<Int> m_startOfCodedInterval;
395  std::vector<Int> m_codedPivotValue;
396  std::vector<Int> m_targetPivotValue;
409 };
410 
411 class SEIKneeFunctionInfo : public SEI
412 {
413 public:
416  virtual ~SEIKneeFunctionInfo() {}
417 
426  std::vector<Int> m_kneeInputKneePoint;
427  std::vector<Int> m_kneeOutputKneePoint;
428 };
429 
431 {
432 public:
436  if(m_verChromaFilterIdc == 1)
437  {
438  for(Int i = 0; i < m_numVerticalFilters; i ++)
439  {
440  free(m_verFilterCoeff[i]);
441  }
442  free(m_verFilterCoeff);
443  free(m_verTapLengthMinus1);
444  }
445  if(m_horChromaFilterIdc == 1)
446  {
447  for(Int i = 0; i < m_numHorizontalFilters; i ++)
448  {
449  free(m_horFilterCoeff[i]);
450  }
451  free(m_horFilterCoeff);
452  free(m_horTapLengthMinus1);
453  }
454  }
455 
467 };
468 
470 {
471 public:
475 
477 };
478 
479 typedef std::list<SEI*> SEIMessages;
480 
483 
486 
488 Void deleteSEIs (SEIMessages &seiList);
489 
490 class SEIScalableNesting : public SEI
491 {
492 public:
494 
497  {
498  if (!m_callerOwnsSEIs)
499  {
501  }
502  }
503 
506  Bool m_defaultOpFlag; //value valid if m_nestingOpFlag != 0
510 
511  Bool m_allLayersFlag; //value valid if m_nestingOpFlag == 0
512  UInt m_nestingNoOpMaxTemporalIdPlus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
513  UInt m_nestingNumLayersMinus1; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
514  UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER]; //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values
515 
518 };
519 
520 class SEITimeCode : public SEI
521 {
522 public:
523  PayloadType payloadType() const { return TIME_CODE; }
525  virtual ~SEITimeCode(){}
526 
529 };
530 
531 //definition according to P1005_v1;
533 {
534  struct TileSetData
535  {
536  protected:
537  std::vector<Int> m_top_left_tile_index; //[tileSetIdx][tileIdx];
538  std::vector<Int> m_bottom_right_tile_index;
539 
540  public:
548 
550  {
551  m_top_left_tile_index .resize(number);
552  m_bottom_right_tile_index.resize(number);
553  }
554 
556  {
557  assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size());
558  return Int(m_top_left_tile_index.size());
559  }
560 
561  Int &topLeftTileIndex (const Int tileRectIndex) { return m_top_left_tile_index [tileRectIndex]; }
562  Int &bottomRightTileIndex(const Int tileRectIndex) { return m_bottom_right_tile_index[tileRectIndex]; }
563  const Int &topLeftTileIndex (const Int tileRectIndex) const { return m_top_left_tile_index [tileRectIndex]; }
564  const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; }
565  };
566 
567 protected:
568  std::vector<TileSetData> m_tile_set_data;
569 
570 public:
571 
578 
580 
581  Void setNumberOfTileSets(const Int number) { m_tile_set_data.resize(number); }
582  Int getNumberOfTileSets() const { return Int(m_tile_set_data.size()); }
583 
584  TileSetData &tileSetData (const Int index) { return m_tile_set_data[index]; }
585  const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; }
586 
587 };
588 
589 #endif
590 
PayloadType payloadType() const
Definition: SEI.h:321
SEIMessages m_nestedSEIs
Definition: SEI.h:517
virtual ~SEIDecodedPictureHash()
Definition: SEI.h:124
virtual ~SEIScalableNesting()
Definition: SEI.h:496
Bool m_callerOwnsSEIs
Definition: SEI.h:516
SEI()
Definition: SEI.h:89
#define MAX_NESTING_NUM_OPS
Definition: TypeDef.h:96
PayloadType payloadType() const
Definition: SEI.h:287
Bool m_currentFrameIsFrame0Flag
Definition: SEI.h:272
Int m_duSptCpbRemovalDelay
Definition: SEI.h:238
PayloadType payloadType() const
Definition: SEI.h:336
PayloadType
Definition: SEI.h:55
Bool m_selfContainedCvsFlag
Definition: SEI.h:151
#define MAX_NESTING_NUM_LAYER
Definition: TypeDef.h:97
Bool m_exposureCompensationValueSignFlag
Definition: SEI.h:401
TComSEIMasteringDisplay values
Definition: SEI.h:476
Bool m_max_mcs_tier_level_idc_present_flag
Definition: SEI.h:575
Int m_frame1GridPositionX
Definition: SEI.h:277
UInt m_nestingOpIdx[1024]
Definition: SEI.h:509
virtual ~SEIMasteringDisplayColourVolume()
Definition: SEI.h:474
virtual ~SEIKneeFunctionInfo()
Definition: SEI.h:416
Int m_contentInterpretationType
Definition: SEI.h:268
virtual ~SEISOPDescription()
Definition: SEI.h:365
Int m_exposureIndexIdc
Definition: SEI.h:399
Bool m_frame1SelfContainedFlag
Definition: SEI.h:274
SEIBufferingPeriod()
Definition: SEI.h:162
Int m_exposureCompensationValueNumerator
Definition: SEI.h:402
void Void
Definition: TypeDef.h:285
PayloadType payloadType() const
Definition: SEI.h:433
std::vector< Int > m_targetPivotValue
Definition: SEI.h:396
static const Char * getSEIMessageString(SEI::PayloadType payloadType)
Definition: SEI.cpp:90
Bool m_fieldViewsFlag
Definition: SEI.h:271
UInt m_dpbDelayOffset
Definition: SEI.h:178
Bool m_exactMatchingFlag
Definition: SEI.h:252
Bool m_arrangementPersistenceFlag
Definition: SEI.h:280
SEIRecoveryPoint()
Definition: SEI.h:248
virtual ~SEI()
Definition: SEI.h:90
#define NULL
Definition: CommonDef.h:100
Bool m_kneePersistenceFlag
Definition: SEI.h:420
Int & topLeftTileIndex(const Int tileRectIndex)
Definition: SEI.h:561
UInt m_picDpbOutputDelay
Definition: SEI.h:216
std::vector< Int > m_kneeOutputKneePoint
Definition: SEI.h:427
Int m_decodingUnitIdx
Definition: SEI.h:237
Bool m_frame0FlippedFlag
Definition: SEI.h:270
std::vector< Int > m_kneeInputKneePoint
Definition: SEI.h:426
char Char
Definition: TypeDef.h:291
unsigned int UInt
Definition: TypeDef.h:297
Bool m_rapCpbParamsPresentFlag
Definition: SEI.h:176
Int m_frame0GridPositionX
Definition: SEI.h:275
UInt m_cpbDelayOffset
Definition: SEI.h:177
Void deleteSEIs(SEIMessages &seiList)
delete list of SEI messages (freeing the referenced objects)
Definition: SEI.cpp:79
SEIFramePacking()
Definition: SEI.h:261
virtual ~SEISegmentedRectFramePacking()
Definition: SEI.h:290
#define MAX_TLAYER
max number of temporal layer
Definition: CommonDef.h:192
Bool m_frame0SelfContainedFlag
Definition: SEI.h:273
SEINoDisplay()
Definition: SEI.h:351
Int m_numPivots
Definition: SEI.h:394
Int m_minValue
Definition: SEI.h:389
UChar m_nestingLayerId[64]
Definition: SEI.h:514
UChar * userData
Definition: SEI.h:115
UInt numClockTs
Definition: SEI.h:527
TileSetData & tileSetData(const Int index)
Definition: SEI.h:584
virtual ~SEIBufferingPeriod()
Definition: SEI.h:173
Bool m_verFilteringProcessFlag
Definition: SEI.h:458
PayloadType payloadType() const
Definition: SEI.h:246
PayloadType payloadType() const
Definition: SEI.h:140
PayloadType payloadType() const
Definition: SEI.h:300
Int m_nominalBlackLevelLumaCodeValue
Definition: SEI.h:406
std::vector< Int > activeSeqParameterSetId
Definition: SEI.h:154
virtual ~SEITimeCode()
Definition: SEI.h:525
Int m_sopDescPocDelta[1024]
Definition: SEI.h:373
PayloadType payloadType() const
Definition: SEI.h:523
SEIPictureTiming()
Definition: SEI.h:191
UInt m_picStruct
Definition: SEI.h:211
virtual ~SEIChromaSamplingFilterHint()
Definition: SEI.h:435
Int m_picSptDpbOutputDuDelay
Definition: SEI.h:240
PayloadType payloadType() const
Definition: SEI.h:102
Int m_kneeOutputDrange
Definition: SEI.h:423
UInt m_initialCpbRemovalDelay[32][2]
Definition: SEI.h:179
PayloadType payloadType() const
Definition: SEI.h:493
Int m_frame1GridPositionY
Definition: SEI.h:278
Int m_kneeInputDispLuminance
Definition: SEI.h:422
UInt m_sopDescTemporalId[1024]
Definition: SEI.h:371
SEISOPDescription()
Definition: SEI.h:364
UInt m_sourceScanType
Definition: SEI.h:212
SEIKneeFunctionInfo()
Definition: SEI.h:415
std::vector< Int > m_startOfCodedInterval
Definition: SEI.h:393
SEIDecodingUnitInfo()
Definition: SEI.h:230
UInt m_numPicsInSopMinus1
Definition: SEI.h:368
Int m_maxValue
Definition: SEI.h:390
static const UInt ISO_IEC_11578_LEN
Definition: SEI.h:97
bool Bool
Definition: TypeDef.h:286
SEIToneMappingInfo()
Definition: SEI.h:380
Bool m_allLayersFlag
Definition: SEI.h:511
Int m_sigmoidWidth
Definition: SEI.h:392
std::vector< Int > m_top_left_tile_index
Definition: SEI.h:537
const TileSetData & tileSetData(const Int index) const
Definition: SEI.h:585
TComDigest m_digest
Definition: SEI.h:134
SEIScalableNesting()
Definition: SEI.h:495
Int m_nominalWhiteLevelLumaCodeValue
Definition: SEI.h:407
Int m_cameraIsoSpeedIdc
Definition: SEI.h:397
SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
remove a selection of SEI messages by payload type from the original list and return them in a new li...
Definition: SEI.cpp:58
Definition: SEI.h:52
Int & bottomRightTileIndex(const Int tileRectIndex)
Definition: SEI.h:562
UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]
Definition: SEI.h:113
virtual PayloadType payloadType() const =0
Int m_toneMapId
Definition: SEI.h:383
UInt * m_duCpbRemovalDelayMinus1
Definition: SEI.h:222
UInt m_numDecodingUnitsMinus1
Definition: SEI.h:218
UInt m_bpSeqParameterSetId
Definition: SEI.h:175
Bool m_quincunxSamplingFlag
Definition: SEI.h:267
PayloadType payloadType() const
Definition: SEI.h:379
#define MAX_CPB_CNT
Upper bound of (cpb_cnt_minus1 + 1)
Definition: TypeDef.h:106
UInt m_nestingNumOpsMinus1
Definition: SEI.h:507
const Int & bottomRightTileIndex(const Int tileRectIndex) const
Definition: SEI.h:564
UInt m_auCpbRemovalDelayDelta
Definition: SEI.h:184
virtual ~SEITemporalLevel0Index()
Definition: SEI.h:327
unsigned char UChar
Definition: TypeDef.h:293
virtual ~SEIFramePacking()
Definition: SEI.h:262
Bool m_arrangementCancelFlag
Definition: SEI.h:265
Int m_codedDataBitDepth
Definition: SEI.h:386
UInt m_nestingNoOpMaxTemporalIdPlus1
Definition: SEI.h:512
std::vector< Int > m_bottom_right_tile_index
Definition: SEI.h:538
Int m_extendedWhiteLevelLumaCodeValue
Definition: SEI.h:408
Void setNumberOfTileRects(const Int number)
Definition: SEI.h:549
UInt m_duCommonCpbRemovalDelayMinus1
Definition: SEI.h:220
virtual ~SEINoDisplay()
Definition: SEI.h:354
std::vector< TileSetData > m_tile_set_data
Definition: SEI.h:568
Int getNumberOfTileSets() const
Definition: SEI.h:582
UInt anticlockwiseRotation
Definition: SEI.h:313
Bool m_spatialFlippingFlag
Definition: SEI.h:269
Void setNumberOfTileSets(const Int number)
Definition: SEI.h:581
PayloadType payloadType() const
Definition: SEI.h:189
PayloadType payloadType() const
Definition: SEI.h:472
UInt m_sopDescVclNaluType[1024]
Definition: SEI.h:370
virtual ~SEIRecoveryPoint()
Definition: SEI.h:249
UInt m_nestingMaxTemporalIdPlus1[MAX_TLAYER]
Definition: SEI.h:508
#define MAX_TIMECODE_SEI_SETS
Maximum number of time sets.
Definition: TypeDef.h:252
Bool m_noDisplay
Definition: SEI.h:356
#define MAX_NUM_PICS_IN_SOP
Definition: TypeDef.h:94
Int m_recoveryPocCnt
Definition: SEI.h:251
virtual ~SEIGradualDecodingRefreshInfo()
Definition: SEI.h:341
UInt m_initialAltCpbRemovalDelayOffset[32][2]
Definition: SEI.h:182
UInt m_initialCpbRemovalDelayOffset[32][2]
Definition: SEI.h:180
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
PayloadType payloadType() const
Definition: SEI.h:362
Int m_exposureIndexValue
Definition: SEI.h:400
Bool m_nestingOpFlag
Definition: SEI.h:505
PayloadType payloadType() const
Definition: SEI.h:160
Int m_arrangementType
Definition: SEI.h:266
Bool m_duCommonCpbRemovalDelayFlag
Definition: SEI.h:219
Int m_exposureCompensationValueDenomIdc
Definition: SEI.h:403
Int m_arrangementId
Definition: SEI.h:264
PayloadType payloadType() const
Definition: SEI.h:121
UInt * m_numNalusInDuMinus1
Definition: SEI.h:221
std::vector< Int > m_codedPivotValue
Definition: SEI.h:395
PayloadType payloadType() const
Definition: SEI.h:579
Int m_kneeOutputDispLuminance
Definition: SEI.h:424
PayloadType payloadType() const
Definition: SEI.h:228
Int m_sigmoidMidpoint
Definition: SEI.h:391
std::list< SEI * > SEIMessages
Definition: SEI.h:479
UInt m_auCpbRemovalDelay
Definition: SEI.h:215
enum SEIDecodedPictureHash::Method method
Int m_extendedRangeWhiteLevel
Definition: SEI.h:405
Bool m_perfectReconstructionFlag
Definition: SEI.h:460
UInt m_nestingNumLayersMinus1
Definition: SEI.h:513
int Int
Definition: TypeDef.h:296
Bool persistenceFlag
Definition: SEI.h:314
Bool m_mc_all_tiles_exact_sample_value_match_flag
Definition: SEI.h:572
Int m_refScreenLuminanceWhite
Definition: SEI.h:404
Bool m_concatenationFlag
Definition: SEI.h:183
Bool m_brokenLinkFlag
Definition: SEI.h:253
Bool m_toneMapPersistenceFlag
Definition: SEI.h:385
Int m_kneeInputDrange
Definition: SEI.h:421
Int m_kneeNumKneePointsMinus1
Definition: SEI.h:425
PayloadType payloadType() const
Definition: SEI.h:259
Int m_frame0GridPositionY
Definition: SEI.h:276
UInt m_picDpbOutputDuDelay
Definition: SEI.h:217
Bool m_toneMapCancelFlag
Definition: SEI.h:384
Int m_cameraIsoSpeedValue
Definition: SEI.h:398
UInt m_initialAltCpbRemovalDelay[32][2]
Definition: SEI.h:181
Bool m_dpbOutputDuDelayPresentFlag
Definition: SEI.h:239
Bool m_noParameterSetUpdateFlag
Definition: SEI.h:152
virtual ~SEIDecodingUnitInfo()
Definition: SEI.h:236
Define basic types, new types and enumerations.
const Int & topLeftTileIndex(const Int tileRectIndex) const
Definition: SEI.h:563
Bool m_upsampledAspectRatio
Definition: SEI.h:281
Bool m_kneeCancelFlag
Definition: SEI.h:419
virtual ~SEIActiveParameterSets()
Definition: SEI.h:148
Int m_arrangementReservedByte
Definition: SEI.h:279
virtual ~SEIuserDataUnregistered()
Definition: SEI.h:108
Bool extensionFlag
Definition: SEI.h:315
Bool m_defaultOpFlag
Definition: SEI.h:506
SEITimeCode()
Definition: SEI.h:524
Int m_targetBitDepth
Definition: SEI.h:387
virtual ~SEIPictureTiming()
Definition: SEI.h:199
Bool m_bitStreamSubsetFlag
Definition: SEI.h:504
UInt m_sopSeqParameterSetId
Definition: SEI.h:367
PayloadType payloadType() const
Definition: SEI.h:414
virtual ~SEIDisplayOrientation()
Definition: SEI.h:307
TComSEITimeSet timeSetArray[3]
Definition: SEI.h:528
Bool m_duplicateFlag
Definition: SEI.h:213
PayloadType payloadType() const
Definition: SEI.h:349
virtual ~SEIToneMappingInfo()
Definition: SEI.h:381
SPS class.
Definition: TComSlice.h:722
Bool m_arrangementPersistenceFlag
Definition: SEI.h:294
UInt m_sopDescStRpsIdx[1024]
Definition: SEI.h:372