Tag Parser  6.4.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 AVCINFO_H
2 #define AVCINFO_H
3 
4 #include "../margin.h"
5 #include "../size.h"
6 #include "../aspectratio.h"
7 
8 namespace IoUtilities {
9 class BinaryReader;
10 class BitReader;
11 }
12 
13 namespace Media {
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 
34 inline TimingInfo::TimingInfo() :
35  unitsInTick(0),
36  timeScale(0),
37  isPresent(0),
38  fixedFrameRate(0)
39 {}
40 
41 inline int64 TimingInfo::defaultDuration() const
42 {
43  return 1000000000ll * unitsInTick / timeScale;
44 }
45 
47  HrdParameters();
48  ugolomb cpbCount;
55 
56  void parse(IoUtilities::BitReader &reader);
57 };
58 
60  cpbCount(0),
61  bitRateScale(0),
62  cpbSizeScale(0),
63  initialCpbRemovalDelayLength(0),
64  cpbRemovalDelayLength(0),
65  cpbOutputDelayLength(0),
66  timeOffsetLength(0)
67 {}
68 
70  SpsInfo();
71  ugolomb id;
77  ugolomb log2MaxFrameNum;
84  byte vuiPresent;
93  uint16 size;
94 
95  void parse(IoUtilities::BinaryReader &reader, uint32 maxSize);
96 };
97 
98 inline SpsInfo::SpsInfo() :
99  id(0),
100  profileIndication(0),
101  profileConstraints(0),
102  levelIndication(0),
103  chromaFormatIndication(0),
104  pictureOrderCountType(0),
105  log2MaxFrameNum(0),
106  log2MaxPictureOrderCountLsb(0),
107  offsetForNonRefPic(0),
108  offsetForTopToBottomField(0),
109  numRefFramesInPicOrderCntCycle(0),
110  deltaPicOrderAlwaysZeroFlag(0),
111  frameMbsOnly(0),
112  vuiPresent(0),
113  hrdParametersPresent(0),
114  pictureStructPresent(0),
115  size(0)
116 {}
117 
119  PpsInfo();
120  ugolomb id;
121  ugolomb spsId;
123  uint16 size;
124 
125  void parse(IoUtilities::BinaryReader &reader, uint32 maxSize);
126 };
127 
129  id(0),
130  spsId(0),
131  picOrderPresent(false),
132  size(0)
133 {}
134 
136  SliceInfo();
137  byte naluType;
139  byte type;
140  byte ppsId;
141  uint32 frameNum;
144  uint32 idrPicId;
147  uint32 deltaPicOrderCnt[2];
149  uint32 sps;
150  uint32 pps;
151 };
152 
154  naluType(0),
155  naluRefIdc(0),
156  type(0),
157  ppsId(0),
158  frameNum(0),
159  fieldPicFlag(false),
160  bottomFieldFlag(false),
161  idrPicId(0),
162  picOrderCntLsb(0),
163  deltaPicOrderCntBottom(0),
164  deltaPicOrderCnt{0,0},
165  firstMbInSlice(0),
166  sps(0),
167  pps(0)
168 {}
169 
171  AvcFrame();
172  uint64 start;
173  uint64 end;
174  uint64 ref1;
175  uint64 ref2;
176  bool keyframe;
180  uint32 decodeOrder;
181 };
182 
184  start(0),
185  end(0),
186  ref1(0),
187  ref2(0),
188  keyframe(false),
189  hasProvidedTimecode(false),
190  presentationOrder(0),
191  decodeOrder(0)
192 {}
193 
194 
195 }
196 
197 #endif // AVCINFO_H
uint32 firstMbInSlice
Definition: avcinfo.h:148
byte deltaPicOrderAlwaysZeroFlag
Definition: avcinfo.h:82
The SpsInfo struct holds the sequence parameter set.
Definition: avcinfo.h:69
ugolomb spsId
Definition: avcinfo.h:121
void parse(IoUtilities::BitReader &reader)
Parses HRD parameters.
Definition: avcinfo.cpp:261
The Size class defines the size of a two-dimensional object using integer point precision.
Definition: size.h:16
bool hasProvidedTimecode
Definition: avcinfo.h:177
The AspectRatio struct defines an aspect ratio.
Definition: aspectratio.h:10
byte hrdParametersPresent
Definition: avcinfo.h:89
byte levelIndication
Definition: avcinfo.h:74
bool fieldPicFlag
Definition: avcinfo.h:142
Size pictureSize
Definition: avcinfo.h:88
uint32 timeScale
Definition: avcinfo.h:28
uint32 decodeOrder
Definition: avcinfo.h:180
SliceInfo sliceInfo
Definition: avcinfo.h:178
byte pictureStructPresent
Definition: avcinfo.h:92
Margin cropping
Definition: avcinfo.h:87
uint64 start
Definition: avcinfo.h:172
uint32 presentationOrder
Definition: avcinfo.h:179
AspectRatio pixelAspectRatio
Definition: avcinfo.h:85
uint32 picOrderCntLsb
Definition: avcinfo.h:145
sgolomb offsetForNonRefPic
Definition: avcinfo.h:79
void parse(IoUtilities::BinaryReader &reader, uint32 maxSize)
Parses the SPS info.
Definition: avcinfo.cpp:25
The HrdParameters struct holds "Hypothetical Reference Decoder" parameters.
Definition: avcinfo.h:46
ugolomb log2MaxPictureOrderCountLsb
Definition: avcinfo.h:78
uint32 unitsInTick
Definition: avcinfo.h:27
Contains utility classes helping to read and write streams.
ugolomb log2MaxFrameNum
Definition: avcinfo.h:77
uint32 frameNum
Definition: avcinfo.h:141
uint64 ref1
Definition: avcinfo.h:174
ugolomb chromaFormatIndication
Definition: avcinfo.h:75
ugolomb pictureOrderCountType
Definition: avcinfo.h:76
uint64 end
Definition: avcinfo.h:173
byte fixedFrameRate
Definition: avcinfo.h:30
bool bottomFieldFlag
Definition: avcinfo.h:143
ugolomb id
Definition: avcinfo.h:71
HrdParameters nalHrdParameters
Definition: avcinfo.h:90
byte frameMbsOnly
Definition: avcinfo.h:83
uint32 deltaPicOrderCntBottom
Definition: avcinfo.h:146
uint32 ugolomb
Type used to store unsigned integer values using golomb coding.
Definition: avcinfo.h:18
The AvcFrame struct holds an AVC frame.
Definition: avcinfo.h:170
HrdParameters vclHrdParameters
Definition: avcinfo.h:91
The PpsInfo struct holds the picture parameter set.
Definition: avcinfo.h:118
ugolomb cpbCount
Definition: avcinfo.h:48
int64 defaultDuration() const
Definition: avcinfo.h:41
byte cpbOutputDelayLength
Definition: avcinfo.h:53
int32 sgolomb
Type used to store signed integer values using golomb coding.
Definition: avcinfo.h:23
byte profileIndication
Definition: avcinfo.h:72
uint16 size
Definition: avcinfo.h:93
sgolomb offsetForTopToBottomField
Definition: avcinfo.h:80
TimingInfo timingInfo
Definition: avcinfo.h:86
uint16 size
Definition: avcinfo.h:123
uint64 ref2
Definition: avcinfo.h:175
byte vuiPresent
Definition: avcinfo.h:84
byte picOrderPresent
Definition: avcinfo.h:122
ugolomb numRefFramesInPicOrderCntCycle
Definition: avcinfo.h:81
byte initialCpbRemovalDelayLength
Definition: avcinfo.h:51
byte cpbRemovalDelayLength
Definition: avcinfo.h:52
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
The TimingInfo struct holds timing information (part of SPS info).
Definition: avcinfo.h:25
The SliceInfo struct holds the slice information of an AVC frame.
Definition: avcinfo.h:135
ugolomb id
Definition: avcinfo.h:120
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
uint32 idrPicId
Definition: avcinfo.h:144
byte profileConstraints
Definition: avcinfo.h:73
The Margin class defines the four margins of a rectangle.
Definition: margin.h:16