Tag Parser  7.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
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 
8 namespace IoUtilities {
9 class BinaryReader;
10 class BitReader;
11 } // namespace IoUtilities
12 
13 namespace TagParser {
14 
18 typedef uint32 ugolomb;
19 
23 typedef int32 sgolomb;
24 
26  TimingInfo();
27  uint32 unitsInTick;
28  uint32 timeScale;
29  byte isPresent;
31  int64 defaultDuration() const;
32 };
33 
35  : unitsInTick(0)
36  , timeScale(0)
37  , isPresent(0)
38  , fixedFrameRate(0)
39 {
40 }
41 
42 inline int64 TimingInfo::defaultDuration() const
43 {
44  return 1000000000ll * unitsInTick / timeScale;
45 }
46 
48  HrdParameters();
56 
57  void parse(IoUtilities::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  SpsInfo();
86  byte vuiPresent;
95  uint16 size;
96 
97  void parse(IoUtilities::BinaryReader &reader, uint32 maxSize);
98 };
99 
101  : id(0)
102  , profileIndication(0)
103  , profileConstraints(0)
104  , levelIndication(0)
105  , chromaFormatIndication(0)
106  , pictureOrderCountType(0)
107  , log2MaxFrameNum(0)
108  , log2MaxPictureOrderCountLsb(0)
109  , offsetForNonRefPic(0)
110  , offsetForTopToBottomField(0)
111  , numRefFramesInPicOrderCntCycle(0)
112  , deltaPicOrderAlwaysZeroFlag(0)
113  , frameMbsOnly(0)
114  , vuiPresent(0)
115  , hrdParametersPresent(0)
116  , pictureStructPresent(0)
117  , size(0)
118 {
119 }
120 
122  PpsInfo();
126  uint16 size;
127 
128  void parse(IoUtilities::BinaryReader &reader, uint32 maxSize);
129 };
130 
132  : id(0)
133  , spsId(0)
134  , picOrderPresent(false)
135  , size(0)
136 {
137 }
138 
140  SliceInfo();
141  byte naluType;
143  byte type;
144  byte ppsId;
145  uint32 frameNum;
148  uint32 idrPicId;
151  uint32 deltaPicOrderCnt[2];
153  uint32 sps;
154  uint32 pps;
155 };
156 
158  : naluType(0)
159  , naluRefIdc(0)
160  , type(0)
161  , ppsId(0)
162  , frameNum(0)
163  , fieldPicFlag(false)
164  , bottomFieldFlag(false)
165  , idrPicId(0)
166  , picOrderCntLsb(0)
167  , deltaPicOrderCntBottom(0)
168  , deltaPicOrderCnt{ 0, 0 }
169  , firstMbInSlice(0)
170  , sps(0)
171  , pps(0)
172 {
173 }
174 
176  AvcFrame();
177  uint64 start;
178  uint64 end;
179  uint64 ref1;
180  uint64 ref2;
181  bool keyframe;
185  uint32 decodeOrder;
186 };
187 
189  : start(0)
190  , end(0)
191  , ref1(0)
192  , ref2(0)
193  , keyframe(false)
194  , hasProvidedTimecode(false)
195  , presentationOrder(0)
196  , decodeOrder(0)
197 {
198 }
199 
200 } // namespace TagParser
201 
202 #endif // TAG_PARSER_AVCINFO_H
The Margin class defines the four margins of a rectangle.
Definition: margin.h:16
ugolomb chromaFormatIndication
Definition: avcinfo.h:77
The SliceInfo struct holds the slice information of an AVC frame.
Definition: avcinfo.h:139
The TimingInfo struct holds timing information (part of SPS info).
Definition: avcinfo.h:25
AspectRatio pixelAspectRatio
Definition: avcinfo.h:87
uint32 deltaPicOrderCntBottom
Definition: avcinfo.h:150
byte levelIndication
Definition: avcinfo.h:76
sgolomb offsetForTopToBottomField
Definition: avcinfo.h:82
uint32 ugolomb
Type used to store unsigned integer values using golomb coding.
Definition: avcinfo.h:18
HrdParameters vclHrdParameters
Definition: avcinfo.h:93
byte picOrderPresent
Definition: avcinfo.h:125
SliceInfo sliceInfo
Definition: avcinfo.h:183
uint32 firstMbInSlice
Definition: avcinfo.h:152
byte pictureStructPresent
Definition: avcinfo.h:94
TimingInfo timingInfo
Definition: avcinfo.h:88
uint32 decodeOrder
Definition: avcinfo.h:185
The SpsInfo struct holds the sequence parameter set.
Definition: avcinfo.h:71
The Size class defines the size of a two-dimensional object using integer point precision.
Definition: size.h:16
Contains utility classes helping to read and write streams.
byte hrdParametersPresent
Definition: avcinfo.h:91
int32 sgolomb
Type used to store signed integer values using golomb coding.
Definition: avcinfo.h:23
uint32 picOrderCntLsb
Definition: avcinfo.h:149
ugolomb pictureOrderCountType
Definition: avcinfo.h:78
Margin cropping
Definition: avcinfo.h:89
uint32 presentationOrder
Definition: avcinfo.h:184
ugolomb numRefFramesInPicOrderCntCycle
Definition: avcinfo.h:83
int64 defaultDuration() const
Definition: avcinfo.h:42
sgolomb offsetForNonRefPic
Definition: avcinfo.h:81
HrdParameters nalHrdParameters
Definition: avcinfo.h:92
byte initialCpbRemovalDelayLength
Definition: avcinfo.h:52
The PpsInfo struct holds the picture parameter set.
Definition: avcinfo.h:121
ugolomb log2MaxPictureOrderCountLsb
Definition: avcinfo.h:80
ugolomb log2MaxFrameNum
Definition: avcinfo.h:79
byte profileIndication
Definition: avcinfo.h:74
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:9
byte profileConstraints
Definition: avcinfo.h:75
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
The AspectRatio struct defines an aspect ratio.
Definition: aspectratio.h:10
The AvcFrame struct holds an AVC frame.
Definition: avcinfo.h:175
byte deltaPicOrderAlwaysZeroFlag
Definition: avcinfo.h:84
The HrdParameters struct holds "Hypothetical Reference Decoder" parameters.
Definition: avcinfo.h:47
bool hasProvidedTimecode
Definition: avcinfo.h:182