Tag Parser  6.2.2
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 
173 private:
174  uint64 m_start;
175  uint64 m_end;
176  uint64 m_ref1;
177  uint64 m_ref2;
178  bool m_keyframe;
179  bool m_hasProvidedTimecode;
180  SliceInfo m_sliceInfo;
181  uint32 m_presentationOrder;
182  uint32 m_decodeOrder;
183 };
184 
185 inline AvcFrame::AvcFrame() :
186  m_start(0),
187  m_end(0),
188  m_ref1(0),
189  m_ref2(0),
190  m_keyframe(false),
191  m_hasProvidedTimecode(false),
192  m_presentationOrder(0),
193  m_decodeOrder(0)
194 {}
195 
196 
197 }
198 
199 #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
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
byte pictureStructPresent
Definition: avcinfo.h:92
Margin cropping
Definition: avcinfo.h:87
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
ugolomb chromaFormatIndication
Definition: avcinfo.h:75
ugolomb pictureOrderCountType
Definition: avcinfo.h:76
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
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
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
The AvcFrame struct holds an AVC frame.
Definition: avcinfo.h:170
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