Tag Parser 12.3.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
avcinfo.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_AVCINFO_H
2#define TAG_PARSER_AVCINFO_H
3
4#include "../aspectratio.h"
5#include "../margin.h"
6#include "../size.h"
7
8namespace CppUtilities {
9class BinaryReader;
10class BitReader;
11} // namespace CppUtilities
12
13namespace TagParser {
14
18using ugolomb = std::uint32_t;
19
23using sgolomb = std::int32_t;
24
26 constexpr TimingInfo();
27 std::uint32_t unitsInTick;
28 std::uint32_t timeScale;
29 std::uint8_t isPresent;
30 std::uint8_t fixedFrameRate;
31 constexpr std::int64_t defaultDuration() const;
32};
33
35 : unitsInTick(0)
36 , timeScale(0)
37 , isPresent(0)
38 , fixedFrameRate(0)
39{
40}
41
42constexpr std::int64_t TimingInfo::defaultDuration() const
43{
44 return 1000000000ll * unitsInTick / timeScale;
45}
46
48 constexpr HrdParameters();
50 std::uint8_t bitRateScale;
51 std::uint8_t cpbSizeScale;
55 std::uint8_t timeOffsetLength;
56
57 void parse(CppUtilities::BitReader &reader);
58};
59
61 : cpbCount(0)
62 , bitRateScale(0)
63 , cpbSizeScale(0)
64 , initialCpbRemovalDelayLength(0)
65 , cpbRemovalDelayLength(0)
66 , cpbOutputDelayLength(0)
67 , timeOffsetLength(0)
68{
69}
70
72 constexpr SpsInfo();
74 std::uint8_t profileIndication;
75 std::uint8_t profileConstraints;
76 std::uint8_t levelIndication;
85 std::uint8_t frameMbsOnly;
86 std::uint8_t vuiPresent;
95 std::uint16_t size;
96 static constexpr std::uint16_t minSize = 2;
97
98 void parse(CppUtilities::BinaryReader &reader, std::uint32_t maxSize);
99};
100
102 : id(0)
103 , profileIndication(0)
104 , profileConstraints(0)
105 , levelIndication(0)
106 , chromaFormatIndication(0)
107 , pictureOrderCountType(0)
108 , log2MaxFrameNum(0)
109 , log2MaxPictureOrderCountLsb(0)
110 , offsetForNonRefPic(0)
111 , offsetForTopToBottomField(0)
112 , numRefFramesInPicOrderCntCycle(0)
113 , deltaPicOrderAlwaysZeroFlag(0)
114 , frameMbsOnly(0)
115 , vuiPresent(0)
116 , hrdParametersPresent(0)
117 , pictureStructPresent(0)
118 , size(0)
119{
120}
121
123 constexpr PpsInfo();
126 std::uint8_t picOrderPresent;
127 std::uint16_t size;
128 static constexpr std::uint16_t minSize = 2;
129
130 void parse(CppUtilities::BinaryReader &reader, std::uint32_t maxSize);
131};
132
134 : id(0)
135 , spsId(0)
136 , picOrderPresent(false)
137 , size(0)
138{
139}
140
142 constexpr SliceInfo();
143 std::uint8_t naluType;
144 std::uint8_t naluRefIdc;
145 std::uint8_t type;
146 std::uint8_t ppsId;
147 std::uint32_t frameNum;
150 std::uint32_t idrPicId;
151 std::uint32_t picOrderCntLsb;
153 std::uint32_t deltaPicOrderCnt[2];
154 std::uint32_t firstMbInSlice;
155 std::uint32_t sps;
156 std::uint32_t pps;
157};
158
160 : naluType(0)
161 , naluRefIdc(0)
162 , type(0)
163 , ppsId(0)
164 , frameNum(0)
165 , fieldPicFlag(false)
166 , bottomFieldFlag(false)
167 , idrPicId(0)
168 , picOrderCntLsb(0)
169 , deltaPicOrderCntBottom(0)
170 , deltaPicOrderCnt{ 0, 0 }
171 , firstMbInSlice(0)
172 , sps(0)
173 , pps(0)
174{
175}
176
178 constexpr AvcFrame();
179 std::uint64_t start;
180 std::uint64_t end;
181 std::uint64_t ref1;
182 std::uint64_t ref2;
184 std::uint32_t presentationOrder;
185 std::uint32_t decodeOrder;
188};
189
191 : start(0)
192 , end(0)
193 , ref1(0)
194 , ref2(0)
195 , presentationOrder(0)
196 , decodeOrder(0)
197 , keyframe(false)
198 , hasProvidedTimecode(false)
199{
200}
201
202} // namespace TagParser
203
204#endif // TAG_PARSER_AVCINFO_H
The Margin class defines the four margins of a rectangle.
Definition margin.h:16
The Size class defines the size of a two-dimensional object using integer point precision.
Definition size.h:17
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
std::uint32_t ugolomb
Type used to store unsigned integer values using golomb coding.
Definition avcinfo.h:18
std::int32_t sgolomb
Type used to store signed integer values using golomb coding.
Definition avcinfo.h:23
The AspectRatio struct defines an aspect ratio.
The AvcFrame struct holds an AVC frame.
SliceInfo sliceInfo
Definition avcinfo.h:183
std::uint64_t ref1
Definition avcinfo.h:181
std::uint64_t start
Definition avcinfo.h:179
constexpr AvcFrame()
Definition avcinfo.h:190
std::uint32_t presentationOrder
Definition avcinfo.h:184
std::uint64_t end
Definition avcinfo.h:180
std::uint32_t decodeOrder
Definition avcinfo.h:185
std::uint64_t ref2
Definition avcinfo.h:182
The HrdParameters struct holds "Hypothetical Reference Decoder" parameters.
std::uint8_t initialCpbRemovalDelayLength
Definition avcinfo.h:52
std::uint8_t bitRateScale
Definition avcinfo.h:50
std::uint8_t cpbRemovalDelayLength
Definition avcinfo.h:53
std::uint8_t timeOffsetLength
Definition avcinfo.h:55
std::uint8_t cpbOutputDelayLength
Definition avcinfo.h:54
std::uint8_t cpbSizeScale
Definition avcinfo.h:51
constexpr HrdParameters()
Definition avcinfo.h:60
The PpsInfo struct holds the picture parameter set.
constexpr PpsInfo()
Definition avcinfo.h:133
std::uint8_t picOrderPresent
Definition avcinfo.h:126
std::uint16_t size
Definition avcinfo.h:127
The SliceInfo struct holds the slice information of an AVC frame.
constexpr SliceInfo()
Definition avcinfo.h:159
std::uint32_t deltaPicOrderCntBottom
Definition avcinfo.h:152
std::uint32_t sps
Definition avcinfo.h:155
std::uint32_t idrPicId
Definition avcinfo.h:150
std::uint32_t frameNum
Definition avcinfo.h:147
std::uint32_t firstMbInSlice
Definition avcinfo.h:154
std::uint8_t type
Definition avcinfo.h:145
std::uint8_t naluType
Definition avcinfo.h:143
std::uint8_t ppsId
Definition avcinfo.h:146
std::uint32_t pps
Definition avcinfo.h:156
std::uint8_t naluRefIdc
Definition avcinfo.h:144
std::uint32_t picOrderCntLsb
Definition avcinfo.h:151
The SpsInfo struct holds the sequence parameter set.
constexpr SpsInfo()
Definition avcinfo.h:101
std::uint8_t deltaPicOrderAlwaysZeroFlag
Definition avcinfo.h:84
ugolomb pictureOrderCountType
Definition avcinfo.h:78
AspectRatio pixelAspectRatio
Definition avcinfo.h:87
HrdParameters vclHrdParameters
Definition avcinfo.h:93
HrdParameters nalHrdParameters
Definition avcinfo.h:92
TimingInfo timingInfo
Definition avcinfo.h:88
std::uint8_t frameMbsOnly
Definition avcinfo.h:85
std::uint8_t hrdParametersPresent
Definition avcinfo.h:91
std::uint8_t vuiPresent
Definition avcinfo.h:86
ugolomb log2MaxPictureOrderCountLsb
Definition avcinfo.h:80
sgolomb offsetForTopToBottomField
Definition avcinfo.h:82
ugolomb log2MaxFrameNum
Definition avcinfo.h:79
std::uint8_t profileConstraints
Definition avcinfo.h:75
ugolomb numRefFramesInPicOrderCntCycle
Definition avcinfo.h:83
std::uint8_t profileIndication
Definition avcinfo.h:74
std::uint8_t levelIndication
Definition avcinfo.h:76
std::uint16_t size
Definition avcinfo.h:95
sgolomb offsetForNonRefPic
Definition avcinfo.h:81
std::uint8_t pictureStructPresent
Definition avcinfo.h:94
ugolomb chromaFormatIndication
Definition avcinfo.h:77
The TimingInfo struct holds timing information (part of SPS info).
constexpr std::int64_t defaultDuration() const
Definition avcinfo.h:42
std::uint8_t isPresent
Definition avcinfo.h:29
constexpr TimingInfo()
Definition avcinfo.h:34
std::uint8_t fixedFrameRate
Definition avcinfo.h:30
std::uint32_t unitsInTick
Definition avcinfo.h:27
std::uint32_t timeScale
Definition avcinfo.h:28