Coverage Report

Created: 2026-04-01 07:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vvenc/source/Lib/CommonLib/SEI.h
Line
Count
Source
1
/* -----------------------------------------------------------------------------
2
The copyright in this software is being made available under the Clear BSD
3
License, included below. No patent rights, trademark rights and/or 
4
other Intellectual Property Rights other than the copyrights concerning 
5
the Software are granted under this license.
6
7
The Clear BSD License
8
9
Copyright (c) 2019-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.
10
All rights reserved.
11
12
Redistribution and use in source and binary forms, with or without modification,
13
are permitted (subject to the limitations in the disclaimer below) provided that
14
the following conditions are met:
15
16
     * Redistributions of source code must retain the above copyright notice,
17
     this list of conditions and the following disclaimer.
18
19
     * Redistributions in binary form must reproduce the above copyright
20
     notice, this list of conditions and the following disclaimer in the
21
     documentation and/or other materials provided with the distribution.
22
23
     * Neither the name of the copyright holder nor the names of its
24
     contributors may be used to endorse or promote products derived from this
25
     software without specific prior written permission.
26
27
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
28
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
29
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
35
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
36
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
POSSIBILITY OF SUCH DAMAGE.
39
40
41
------------------------------------------------------------------------------------------- */
42
#pragma once
43
44
#include "CommonDef.h"
45
46
#include <list>
47
#include <vector>
48
#include <cstring>
49
50
//! \ingroup CommonLib
51
//! \{
52
53
namespace vvenc {
54
55
/**
56
 * Abstract class representing an SEI message with lightweight RTTI.
57
 */
58
class SEI
59
{
60
public:
61
  enum PayloadType
62
  {
63
    BUFFERING_PERIOD                     = 0,
64
    PICTURE_TIMING                       = 1,
65
    FILLER_PAYLOAD                       = 3,
66
    USER_DATA_REGISTERED_ITU_T_T35       = 4,
67
    USER_DATA_UNREGISTERED               = 5,
68
    FILM_GRAIN_CHARACTERISTICS           = 19,
69
    FRAME_PACKING                        = 45,
70
    PARAMETER_SETS_INCLUSION_INDICATION  = 129,
71
    DECODING_UNIT_INFO                   = 130,
72
    DECODED_PICTURE_HASH                 = 132,
73
    SCALABLE_NESTING                     = 133,
74
    MASTERING_DISPLAY_COLOUR_VOLUME      = 137,
75
    DEPENDENT_RAP_INDICATION             = 145,
76
    EQUIRECTANGULAR_PROJECTION           = 150,
77
    SPHERE_ROTATION                      = 154,
78
    REGION_WISE_PACKING                  = 155,
79
    OMNI_VIEWPORT                        = 156,
80
    GENERALIZED_CUBEMAP_PROJECTION       = 153,
81
    FRAME_FIELD_INFO                     = 168,
82
    SUBPICTURE_LEVEL_INFO                = 203,
83
    SAMPLE_ASPECT_RATIO_INFO             = 204,
84
    CONTENT_LIGHT_LEVEL_INFO             = 144,
85
    ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147,
86
    AMBIENT_VIEWING_ENVIRONMENT          = 148,
87
    CONTENT_COLOUR_VOLUME                = 149,
88
  };
89
90
0
  SEI() {}
91
0
  virtual ~SEI() {}
92
93
  static const char *getSEIMessageString(SEI::PayloadType payloadType);
94
95
  virtual PayloadType payloadType() const = 0;
96
};
97
98
struct SEIMasteringDisplay
99
{
100
  bool        colourVolumeSEIEnabled;
101
  uint32_t    maxLuminance;
102
  uint32_t    minLuminance;
103
  uint16_t    primaries[3][2];
104
  uint16_t    whitePoint[2];
105
};
106
107
108
class SEIEquirectangularProjection : public SEI
109
{
110
public:
111
0
  PayloadType payloadType() const { return EQUIRECTANGULAR_PROJECTION; }
112
113
0
  SEIEquirectangularProjection()  {}
114
0
  virtual ~SEIEquirectangularProjection() {}
115
116
  bool    erpCancelFlag;
117
  bool    erpPersistenceFlag;
118
  bool    erpGuardBandFlag;
119
  uint8_t erpGuardBandType;
120
  uint8_t erpLeftGuardBandWidth;
121
  uint8_t erpRightGuardBandWidth;
122
};
123
124
class SEISphereRotation : public SEI
125
{
126
public:
127
0
  PayloadType payloadType() const { return SPHERE_ROTATION; }
128
129
0
  SEISphereRotation()  {}
130
0
  virtual ~SEISphereRotation() {}
131
132
  bool  sphereRotationCancelFlag;
133
  bool  sphereRotationPersistenceFlag;
134
  int   sphereRotationYaw;
135
  int   sphereRotationPitch;
136
  int   sphereRotationRoll;
137
};
138
139
class SEIOmniViewport : public SEI
140
{
141
public:
142
0
  PayloadType payloadType() const { return OMNI_VIEWPORT; }
143
144
0
  SEIOmniViewport() {}
145
0
  virtual ~SEIOmniViewport() {}
146
147
  struct OmniViewport
148
  {
149
    int      azimuthCentre;
150
    int      elevationCentre;
151
    int      tiltCentre;
152
    uint32_t horRange;
153
    uint32_t verRange;
154
  };
155
156
  uint32_t omniViewportId;
157
  bool     omniViewportCancelFlag;
158
  bool     omniViewportPersistenceFlag;
159
  uint8_t  omniViewportCntMinus1;
160
  std::vector<OmniViewport> omniViewportRegions;
161
};
162
163
class SEIRegionWisePacking : public SEI
164
{
165
public:
166
0
  PayloadType payloadType() const { return REGION_WISE_PACKING; }
167
0
  SEIRegionWisePacking() {}
168
0
  virtual ~SEIRegionWisePacking() {}
169
  bool                  rwpCancelFlag;
170
  bool                  rwpPersistenceFlag;
171
  bool                  constituentPictureMatchingFlag;
172
  int                   numPackedRegions;
173
  int                   projPictureWidth;
174
  int                   projPictureHeight;
175
  int                   packedPictureWidth;
176
  int                   packedPictureHeight;
177
  std::vector<uint8_t>  rwpTransformType;
178
  std::vector<bool>     rwpGuardBandFlag;
179
  std::vector<uint32_t> projRegionWidth;
180
  std::vector<uint32_t> projRegionHeight;
181
  std::vector<uint32_t> rwpProjRegionTop;
182
  std::vector<uint32_t> projRegionLeft;
183
  std::vector<uint16_t> packedRegionWidth;
184
  std::vector<uint16_t> packedRegionHeight;
185
  std::vector<uint16_t> packedRegionTop;
186
  std::vector<uint16_t> packedRegionLeft;
187
  std::vector<uint8_t>  rwpLeftGuardBandWidth;
188
  std::vector<uint8_t>  rwpRightGuardBandWidth;
189
  std::vector<uint8_t>  rwpTopGuardBandHeight;
190
  std::vector<uint8_t>  rwpBottomGuardBandHeight;
191
  std::vector<bool>     rwpGuardBandNotUsedForPredFlag;
192
  std::vector<uint8_t>  rwpGuardBandType;
193
};
194
195
class SEIGeneralizedCubemapProjection : public SEI
196
{
197
public:
198
0
  PayloadType payloadType() const { return GENERALIZED_CUBEMAP_PROJECTION; }
199
200
0
  SEIGeneralizedCubemapProjection()  {}
201
0
  virtual ~SEIGeneralizedCubemapProjection() {}
202
203
  bool                 gcmpCancelFlag;
204
  bool                 gcmpPersistenceFlag;
205
  uint8_t              gcmpPackingType;
206
  uint8_t              gcmpMappingFunctionType;
207
  std::vector<uint8_t> gcmpFaceIndex;
208
  std::vector<uint8_t> gcmpFaceRotation;
209
  std::vector<uint8_t> gcmpFunctionCoeffU;
210
  std::vector<bool>    gcmpFunctionUAffectedByVFlag;
211
  std::vector<uint8_t> gcmpFunctionCoeffV;
212
  std::vector<bool>    gcmpFunctionVAffectedByUFlag;
213
  bool                 gcmpGuardBandFlag;
214
  uint8_t              gcmpGuardBandType;
215
  bool                 gcmpGuardBandBoundaryExteriorFlag;
216
  uint8_t              gcmpGuardBandSamplesMinus1;
217
};
218
219
class SEISampleAspectRatioInfo : public SEI
220
{
221
public:
222
0
  PayloadType payloadType() const { return SAMPLE_ASPECT_RATIO_INFO; }
223
0
  SEISampleAspectRatioInfo() {}
224
0
  virtual ~SEISampleAspectRatioInfo() {}
225
  bool                  sariCancelFlag;
226
  bool                  sariPersistenceFlag;
227
  int                   sariAspectRatioIdc;
228
  int                   sariSarWidth;
229
  int                   sariSarHeight;
230
};
231
232
static const uint32_t ISO_IEC_11578_LEN=16;
233
234
class SEIuserDataUnregistered : public SEI
235
{
236
public:
237
0
  PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
238
239
  SEIuserDataUnregistered()
240
    : userData(0)
241
0
    {}
242
243
  virtual ~SEIuserDataUnregistered()
244
0
  {
245
0
    delete userData;
246
0
  }
247
248
  uint8_t   uuid_iso_iec_11578[ISO_IEC_11578_LEN];
249
  uint32_t  userDataLength;
250
  uint8_t*  userData;
251
};
252
253
class SEIDecodedPictureHash : public SEI
254
{
255
public:
256
0
  PayloadType payloadType() const { return DECODED_PICTURE_HASH; }
257
258
0
  SEIDecodedPictureHash() {}
259
0
  virtual ~SEIDecodedPictureHash() {}
260
261
  vvencHashType  method;
262
  bool           singleCompFlag;
263
  PictureHash    pictureHash;
264
};
265
266
class SEIDependentRAPIndication : public SEI
267
{
268
public:
269
0
  PayloadType payloadType() const { return DEPENDENT_RAP_INDICATION; }
270
0
  SEIDependentRAPIndication() { }
271
272
0
  virtual ~SEIDependentRAPIndication() { }
273
};
274
275
276
class SEIBufferingPeriod : public SEI
277
{
278
public:
279
0
  PayloadType payloadType() const { return BUFFERING_PERIOD; }
280
281
  SEIBufferingPeriod()
282
0
    : bpNalCpbParamsPresent (false)
283
0
    , bpVclCpbParamsPresent (false)
284
0
    , initialCpbRemovalDelayLength (0)
285
0
    , cpbRemovalDelayLength (0)
286
0
    , dpbOutputDelayLength (0)
287
0
    , bpCpbCnt(0)
288
0
    , duCpbRemovalDelayIncrementLength (0)
289
0
    , dpbOutputDelayDuLength (0)
290
0
    , cpbRemovalDelayDeltasPresent (false)
291
0
    , numCpbRemovalDelayDeltas (0)
292
0
    , bpMaxSubLayers (0)
293
0
    , bpDecodingUnitHrdParamsPresent (false)
294
0
    , decodingUnitCpbParamsInPicTimingSeiFlag (false)
295
0
    , decodingUnitDpbDuParamsInPicTimingSeiFlag(false)
296
0
    , sublayerInitialCpbRemovalDelayPresent(false)
297
0
    , additionalConcatenationInfoPresent (false)
298
0
    , maxInitialRemovalDelayForConcatenation (0)
299
0
    , sublayerDpbOutputOffsetsPresent (false)
300
0
    , altCpbParamsPresent (false)
301
0
    , useAltCpbParamsFlag (false)
302
0
  {
303
0
    ::memset( initialCpbRemovalDelay,  0, sizeof(initialCpbRemovalDelay));
304
0
    ::memset( initialCpbRemovalOffset, 0, sizeof(initialCpbRemovalOffset));
305
0
    ::memset( cpbRemovalDelayDelta,    0, sizeof(cpbRemovalDelayDelta));
306
0
    ::memset( dpbOutputTidOffset,      0, sizeof(dpbOutputTidOffset));
307
0
  }
308
0
  virtual ~SEIBufferingPeriod() {}
309
310
  bool      bpNalCpbParamsPresent;
311
  bool      bpVclCpbParamsPresent;
312
  uint32_t  initialCpbRemovalDelayLength;
313
  uint32_t  cpbRemovalDelayLength;
314
  uint32_t  dpbOutputDelayLength;
315
  int       bpCpbCnt;
316
  uint32_t  duCpbRemovalDelayIncrementLength;
317
  uint32_t  dpbOutputDelayDuLength;
318
  uint32_t  initialCpbRemovalDelay         [VVENC_MAX_TLAYER][MAX_CPB_CNT][2];
319
  uint32_t  initialCpbRemovalOffset        [VVENC_MAX_TLAYER][MAX_CPB_CNT][2];
320
  bool      concatenationFlag;
321
  uint32_t  auCpbRemovalDelayDelta;
322
  bool      cpbRemovalDelayDeltasPresent;
323
  int       numCpbRemovalDelayDeltas;
324
  int       bpMaxSubLayers;
325
  uint32_t  cpbRemovalDelayDelta    [15];
326
  bool      bpDecodingUnitHrdParamsPresent;
327
  bool      decodingUnitCpbParamsInPicTimingSeiFlag;
328
  bool      decodingUnitDpbDuParamsInPicTimingSeiFlag;
329
  bool      sublayerInitialCpbRemovalDelayPresent;
330
  bool      additionalConcatenationInfoPresent;
331
  uint32_t  maxInitialRemovalDelayForConcatenation;
332
  bool      sublayerDpbOutputOffsetsPresent;
333
  uint32_t  dpbOutputTidOffset      [VVENC_MAX_TLAYER];
334
  bool      altCpbParamsPresent;
335
  bool      useAltCpbParamsFlag;
336
};
337
338
class SEIPictureTiming : public SEI
339
{
340
public:
341
0
  PayloadType payloadType() const { return PICTURE_TIMING; }
342
343
  SEIPictureTiming()
344
0
  : picDpbOutputDelay (0)
345
0
  , picDpbOutputDuDelay (0)
346
0
  , numDecodingUnitsMinus1 (0)
347
0
  , duCommonCpbRemovalDelayFlag (false)
348
0
  , cpbAltTimingInfoPresent (false)
349
0
  , ptDisplayElementalPeriodsMinus1(0)
350
0
  , delayForConcatenationEnsureFlag(false)
351
0
  {
352
0
    ::memset(ptSubLayerDelaysPresent,         0, sizeof(ptSubLayerDelaysPresent));
353
0
    ::memset(duCommonCpbRemovalDelayMinus1,   0, sizeof(duCommonCpbRemovalDelayMinus1));
354
0
    ::memset(cpbRemovalDelayDeltaEnabledFlag, 0, sizeof(cpbRemovalDelayDeltaEnabledFlag));
355
0
    ::memset(cpbRemovalDelayDeltaIdx,         0, sizeof(cpbRemovalDelayDeltaIdx));
356
0
    ::memset(auCpbRemovalDelay,               0, sizeof(auCpbRemovalDelay));
357
0
  }
358
0
  virtual ~SEIPictureTiming() {}
359
360
  bool                                ptSubLayerDelaysPresent[VVENC_MAX_TLAYER];
361
  bool                                cpbRemovalDelayDeltaEnabledFlag[VVENC_MAX_TLAYER];
362
  uint32_t                            cpbRemovalDelayDeltaIdx[VVENC_MAX_TLAYER];
363
  uint32_t                            auCpbRemovalDelay[VVENC_MAX_TLAYER];
364
  uint32_t                            picDpbOutputDelay;
365
  uint32_t                            picDpbOutputDuDelay;
366
  uint32_t                            numDecodingUnitsMinus1;
367
  bool                                duCommonCpbRemovalDelayFlag;
368
  uint32_t                            duCommonCpbRemovalDelayMinus1[VVENC_MAX_TLAYER];
369
  std::vector<uint32_t>               numNalusInDuMinus1;
370
  std::vector<uint32_t>               duCpbRemovalDelayMinus1;
371
  bool                                cpbAltTimingInfoPresent;
372
  std::vector<std::vector<uint32_t>>  nalCpbAltInitialRemovalDelayDelta;
373
  std::vector<std::vector<uint32_t>>  nalCpbAltInitialRemovalOffsetDelta;
374
  std::vector<uint32_t>               nalCpbDelayOffset;
375
  std::vector<uint32_t>               nalDpbDelayOffset;
376
  std::vector<std::vector<uint32_t>>  vclCpbAltInitialRemovalDelayDelta;
377
  std::vector<std::vector<uint32_t>>  vclCpbAltInitialRemovalOffsetDelta;
378
  std::vector<uint32_t>               vclCpbDelayOffset;
379
  std::vector<uint32_t>               vclDpbDelayOffset;
380
  int                                 ptDisplayElementalPeriodsMinus1;
381
  bool                                delayForConcatenationEnsureFlag; 
382
};
383
384
class SEIDecodingUnitInfo : public SEI
385
{
386
public:
387
0
  PayloadType payloadType() const { return DECODING_UNIT_INFO; }
388
389
  SEIDecodingUnitInfo()
390
0
    : decodingUnitIdx(0)
391
0
    , dpbOutputDuDelayPresent(false)
392
0
    , picSptDpbOutputDuDelay(0)
393
0
  {}
394
0
  virtual ~SEIDecodingUnitInfo() {}
395
396
  int   decodingUnitIdx;
397
  int   duSptCpbRemovalDelayIncrement[VVENC_MAX_TLAYER];
398
  bool  duiSubLayerDelaysPresent[VVENC_MAX_TLAYER];
399
  bool  dpbOutputDuDelayPresent;
400
  int   picSptDpbOutputDuDelay;
401
};
402
403
404
class SEIFrameFieldInfo : public SEI
405
{
406
public:
407
0
  PayloadType payloadType() const { return FRAME_FIELD_INFO; }
408
409
  SEIFrameFieldInfo()
410
    : fieldPicFlag(false)
411
    , bottomFieldFlag (false)
412
    , pairingIndicatedFlag (false)
413
    , pairedWithNextFieldFlag(false)
414
    , displayFieldsFromFrameFlag(false)
415
    , topFieldFirstFlag(false)
416
    , duplicateFlag(false)
417
    , displayElementalPeriodsMinus1(0)
418
    , sourceScanType(0)
419
0
  {}
420
0
  virtual ~SEIFrameFieldInfo() {}
421
422
  bool fieldPicFlag;
423
  bool bottomFieldFlag;
424
  bool pairingIndicatedFlag;
425
  bool pairedWithNextFieldFlag;
426
  bool displayFieldsFromFrameFlag;
427
  bool topFieldFirstFlag;
428
  bool duplicateFlag;
429
  int  displayElementalPeriodsMinus1;
430
  int  sourceScanType;
431
};
432
433
434
class SEIFramePacking : public SEI
435
{
436
public:
437
0
  PayloadType payloadType() const { return FRAME_PACKING; }
438
439
0
  SEIFramePacking() {}
440
0
  virtual ~SEIFramePacking() {}
441
442
  bool arrangementCancelFlag;
443
  bool quincunxSamplingFlag;
444
  bool spatialFlippingFlag;
445
  bool frame0FlippedFlag;
446
  bool fieldViewsFlag;
447
  bool currentFrameIsFrame0Flag;
448
  bool frame0SelfContainedFlag;
449
  bool frame1SelfContainedFlag;
450
  bool arrangementPersistenceFlag;
451
  bool upsampledAspectRatio;
452
  int  arrangementId;
453
  int  arrangementType;
454
  int  contentInterpretationType;
455
  int  frame0GridPositionX;
456
  int  frame0GridPositionY;
457
  int  frame1GridPositionX;
458
  int  frame1GridPositionY;
459
  int  arrangementReservedByte;
460
};
461
462
class SEIParameterSetsInclusionIndication : public SEI
463
{
464
public:
465
0
  PayloadType payloadType() const { return PARAMETER_SETS_INCLUSION_INDICATION; }
466
0
  SEIParameterSetsInclusionIndication() {}
467
0
  virtual ~SEIParameterSetsInclusionIndication() {}
468
469
  int selfContainedClvsFlag;
470
};
471
472
class SEIMasteringDisplayColourVolume : public SEI
473
{
474
public:
475
0
    PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; }
476
0
    SEIMasteringDisplayColourVolume() {}
477
0
    virtual ~SEIMasteringDisplayColourVolume(){}
478
479
    SEIMasteringDisplay values;
480
};
481
482
typedef std::list<SEI*> SEIMessages;
483
484
/// output a selection of SEI messages by payload type. Ownership stays in original message list.
485
SEIMessages getSeisByType(const SEIMessages &seiList, SEI::PayloadType seiType);
486
487
/// remove a selection of SEI messages by payload type from the original list and return them in a new list.
488
SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
489
490
/// delete list of SEI messages (freeing the referenced objects)
491
void deleteSEIs (SEIMessages &seiList);
492
493
class SEIScalableNesting : public SEI
494
{
495
public:
496
0
  PayloadType payloadType() const { return SCALABLE_NESTING; }
497
498
  SEIScalableNesting()
499
  : snOlsFlag (false)
500
  , snSubpicFlag (false)
501
  , snNumOlssMinus1 (0)
502
  , snAllLayersFlag (false)
503
  , snNumLayersMinus1 (0)
504
  , snNumSubpics (1)
505
  , snSubpicIdLen (0)
506
  , snNumSEIs(0)
507
0
  {}
508
509
  virtual ~SEIScalableNesting()
510
0
  {
511
0
    deleteSEIs(nestedSEIs);
512
0
  }
513
514
  bool                  snOlsFlag;
515
  bool                  snSubpicFlag;
516
  uint32_t              snNumOlssMinus1;
517
  uint32_t              snOlsIdxDeltaMinus1[MAX_NESTING_NUM_LAYER];
518
  uint32_t              snOlsIdx[MAX_NESTING_NUM_LAYER];
519
  bool                  snAllLayersFlag;                      //value valid if m_nestingOlsFlag == 0
520
  uint32_t              snNumLayersMinus1;                    //value valid if m_nestingOlsFlag == 0 and m_nestingAllLayersFlag == 0
521
  uint8_t               snLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOlsFlag == 0 and m_nestingAllLayersFlag == 0. This can e.g. be a static array of 64 uint8_t values
522
  uint32_t              snNumSubpics;
523
  uint8_t               snSubpicIdLen;
524
  std::vector<uint16_t> snSubpicId;
525
  uint32_t              snNumSEIs;
526
527
  SEIMessages           nestedSEIs;
528
};
529
530
class SEIAlternativeTransferCharacteristics : public SEI
531
{
532
public:
533
0
  PayloadType payloadType() const { return ALTERNATIVE_TRANSFER_CHARACTERISTICS; }
534
535
0
  SEIAlternativeTransferCharacteristics() : preferredTransferCharacteristics(18)
536
0
  { }
537
538
0
  virtual ~SEIAlternativeTransferCharacteristics() {}
539
540
  uint32_t preferredTransferCharacteristics;
541
};
542
543
class SEIUserDataRegistered : public SEI
544
{
545
public:
546
0
  PayloadType payloadType() const { return USER_DATA_REGISTERED_ITU_T_T35; }
547
548
0
  SEIUserDataRegistered() {}
549
0
  virtual ~SEIUserDataRegistered() {}
550
551
  uint16_t              ituCountryCode;
552
  std::vector<uint8_t>  userData;
553
};
554
555
class SeiFgc : public SEI
556
{
557
public:
558
0
  PayloadType payloadType() const { return FILM_GRAIN_CHARACTERISTICS; }
559
560
0
  SeiFgc() {}
561
0
  virtual ~SeiFgc() {}
562
563
  bool      fgcCancelFlag;
564
  uint8_t   filmGrainModelId;
565
  bool      separateColourDescriptionPresent;
566
  uint8_t   filmGrainBitDepthLumaMinus8;
567
  uint8_t   filmGrainBitDepthChromaMinus8;
568
  bool      filmGrainFullRangeFlag;
569
  uint8_t   filmGrainColourPrimaries;
570
  uint8_t   filmGrainTransferCharacteristics;
571
  uint8_t   filmGrainMatrixCoeffs;
572
  uint8_t   blendingModeId;
573
  uint8_t   log2ScaleFactor;
574
575
  struct CompModelIntensityValues
576
  {
577
    uint8_t intensityIntervalLowerBound;
578
    uint8_t intensityIntervalUpperBound;
579
    std::vector<int> compModelValue;
580
  };
581
582
  struct CompModel
583
  {
584
    bool     presentFlag;
585
    uint8_t  numModelValues;
586
    uint8_t  numIntensityIntervals;
587
    std::vector<CompModelIntensityValues> intensityValues;
588
  };
589
590
  CompModel compModel[MAX_NUM_COMP];
591
  bool      fgcPersistenceFlag;
592
};
593
594
class SEIContentLightLevelInfo : public SEI
595
{
596
public:
597
0
  PayloadType payloadType() const { return CONTENT_LIGHT_LEVEL_INFO; }
598
0
  SEIContentLightLevelInfo() { }
599
600
0
  virtual ~SEIContentLightLevelInfo() { }
601
602
  uint32_t maxContentLightLevel;
603
  uint32_t maxPicAverageLightLevel;
604
};
605
606
class SEIAmbientViewingEnvironment : public SEI
607
{
608
public:
609
0
  PayloadType payloadType() const { return AMBIENT_VIEWING_ENVIRONMENT; }
610
0
  SEIAmbientViewingEnvironment() { }
611
612
0
  virtual ~SEIAmbientViewingEnvironment() { }
613
614
  uint32_t ambientIlluminance;
615
  uint16_t ambientLightX;
616
  uint16_t ambientLightY;
617
};
618
619
class SEIContentColourVolume : public SEI
620
{
621
public:
622
0
  PayloadType payloadType() const { return CONTENT_COLOUR_VOLUME; }
623
0
  SEIContentColourVolume() {}
624
0
  virtual ~SEIContentColourVolume() {}
625
626
  bool      ccvCancelFlag;
627
  bool      ccvPersistenceFlag;
628
  bool      ccvPrimariesPresent;
629
  bool      ccvMinLuminanceValuePresent;
630
  bool      ccvMaxLuminanceValuePresent;
631
  bool      ccvAvgLuminanceValuePresent;
632
  int       ccvPrimariesX[MAX_NUM_COMP];
633
  int       ccvPrimariesY[MAX_NUM_COMP];
634
  uint32_t  ccvMinLuminanceValue;
635
  uint32_t  ccvMaxLuminanceValue;
636
  uint32_t  ccvAvgLuminanceValue;
637
};
638
639
class SEISubpicureLevelInfo : public SEI
640
{
641
public:
642
0
  PayloadType payloadType() const { return SUBPICTURE_LEVEL_INFO; }
643
  SEISubpicureLevelInfo()
644
  : numRefLevels(0)
645
  , explicitFractionPresent (false)
646
  , cbrConstraintFlag (false)
647
  , numSubpics(0)
648
  , sliMaxSublayers(1)
649
  , sliSublayerInfoPresent(false)
650
0
  {}
651
0
  virtual ~SEISubpicureLevelInfo() {}
652
653
  int                                         numRefLevels;
654
  bool                                        explicitFractionPresent;
655
  bool                                        cbrConstraintFlag;
656
  int                                         numSubpics;
657
  int                                         sliMaxSublayers;
658
  bool                                        sliSublayerInfoPresent;
659
  std::vector<std::vector<int>>               nonSubpicLayersFraction;
660
  std::vector<std::vector<vvencLevel>>             refLevelIdc;
661
  std::vector<std::vector<std::vector<int>>>  refLevelFraction;
662
};
663
664
665
} // namespace vvenc
666
667
//! \}
668