Coverage Report

Created: 2026-04-01 07:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vvdec/source/Lib/DecoderLib/SEIread.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) 2018-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVdeC 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
43
/**
44
 \file     SEIread.h
45
 \brief    reading funtionality for SEI messages
46
 */
47
48
#pragma once
49
50
#include "CommonLib/CommonDef.h"
51
52
#include "CommonLib/Slice.h"
53
#include "CommonLib/SEI_internal.h"
54
#include "VLCReader.h"
55
56
namespace vvdec
57
{
58
59
class InputBitstream;
60
61
class SEIReader: public VLCReader
62
{
63
public:
64
0
  SEIReader() {};
65
0
  virtual ~SEIReader() {};
66
  void parseSEImessage(InputBitstream* bs, seiMessages& seiList,
67
                       const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId,
68
                       const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream);
69
70
protected:
71
  void xReadSEImessage                        (seiMessages& seiList, const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId, const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream);
72
  void xParseSEIuserDataUnregistered          (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
73
  void xParseSEIDecodingUnitInfo              (vvdecSEI* s,    uint32_t payloadSize, const vvdecSEIBufferingPeriod& bp, const uint32_t temporalId, std::ostream *pDecodedMessageOutputStream);
74
  void xParseSEIDecodedPictureHash            (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
75
  void xParseSEIBufferingPeriod               (vvdecSEI* s,    uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
76
  void xParseSEIPictureTiming                 (vvdecSEI* s,    uint32_t payloadSize, const uint32_t temporalId, const vvdecSEIBufferingPeriod& bp, std::ostream *pDecodedMessageOutputStream);
77
  void xParseSEIScalableNesting               (vvdecSEI* s, const NalUnitType nalUnitType, const uint32_t nuhLayerId, uint32_t payloadSize, const VPS *vps, const SPS *sps, std::ostream *decodedMessageOutputStream);
78
  void xCheckScalableNestingConstraints       (const vvdecSEIScalableNesting* sei, const NalUnitType nalUnitType, const VPS* vps);
79
  void xParseSEIFrameFieldinfo                (vvdecSEI* s,    uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
80
  void xParseSEIDependentRAPIndication        (vvdecSEI* s,    uint32_t payLoadSize,                     std::ostream *pDecodedMessageOutputStream);
81
  void xParseSEIFramePacking                  (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
82
  void xParseSEIParameterSetsInclusionIndication(vvdecSEI* s,  uint32_t payloadSize,                     std::ostream* pDecodedMessageOutputStream);
83
  void xParseSEIMasteringDisplayColourVolume  ( vvdecSEI* s,   uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
84
#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
85
  void xParseSEIAlternativeTransferCharacteristics(vvdecSEI* s, uint32_t payLoadSize,                     std::ostream *pDecodedMessageOutputStream);
86
#endif
87
  void xParseSEIEquirectangularProjection     (vvdecSEI *s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
88
  void xParseSEISphereRotation                (vvdecSEI *s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
89
  void xParseSEIOmniViewport                  (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
90
  void xParseSEIRegionWisePacking             (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
91
  void xParseSEIGeneralizedCubemapProjection  (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
92
  void xParseSEISubpictureLevelInfo           (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
93
  void xParseSEISampleAspectRatioInfo         (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
94
  void xParseSEIUserDataRegistered            (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
95
  void xParseSEIFilmGrainCharacteristics      (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
96
  void xParseSEIContentLightLevelInfo         (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
97
  void xParseSEIAmbientViewingEnvironment     (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
98
  void xParseSEIContentColourVolume           (vvdecSEI* s,    uint32_t payloadSize,                     std::ostream *pDecodedMessageOutputStream);
99
100
  void sei_read_scode(std::ostream *pOS, uint32_t length,   int& code,         const char *pSymbolName);
101
  void sei_read_code (std::ostream *pOS, uint32_t uiLength, uint32_t& ruiCode, const char *pSymbolName);
102
  void sei_read_uvlc (std::ostream *pOS, uint32_t& ruiCode,                    const char *pSymbolName);
103
  void sei_read_svlc (std::ostream *pOS, int&  ruiCode,                        const char *pSymbolName);
104
  void sei_read_flag (std::ostream *pOS, uint32_t& ruiCode,                    const char *pSymbolName);
105
106
protected:
107
  HRD m_nestedHrd;
108
};
109
110
#if JVET_S0257_DUMP_360SEI_MESSAGE
111
class SeiCfgFileDump
112
{
113
public:
114
  SeiCfgFileDump()
115
  : m_360SEIMessageDumped(false)
116
  {};
117
  virtual ~SeiCfgFileDump() {};
118
119
  void write360SeiDump (std::string decoded360MessageFileName, SEIMessages& seis, const SPS* sps);
120
121
protected:
122
  void xDumpSEIEquirectangularProjection     (SEIEquirectangularProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
123
  void xDumpSEIGeneralizedCubemapProjection  (SEIGeneralizedCubemapProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
124
125
  bool m_360SEIMessageDumped;
126
127
};
128
129
130
#endif
131
132
}