libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
hevcbitstream.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
13#include <cstdint>
14#include <promeki/namespace.h>
15#include <promeki/buffer.h>
16#include <promeki/bufferview.h>
17#include <promeki/error.h>
19#include <promeki/list.h>
20
21PROMEKI_NAMESPACE_BEGIN
22
65struct HevcDecoderConfig {
66 uint8_t configurationVersion = 1;
67 uint8_t generalProfileSpace = 0;
68 uint8_t generalTierFlag = 0;
69 uint8_t generalProfileIdc = 0;
70 uint32_t generalProfileCompatibilityFlags = 0;
71 uint64_t generalConstraintIndicatorFlags = 0;
72 uint8_t generalLevelIdc = 0;
73 uint16_t minSpatialSegmentationIdc = 0;
74 uint8_t parallelismType = 0;
75 uint8_t chromaFormat = 1;
76 uint8_t bitDepthLumaMinus8 = 0;
77 uint8_t bitDepthChromaMinus8 = 0;
78 uint16_t avgFrameRate = 0;
79 uint8_t constantFrameRate = 0;
80 uint8_t numTemporalLayers = 1;
81 uint8_t temporalIdNested = 0;
82 uint8_t lengthSizeMinusOne = 3;
83 List<Buffer> vps;
84 List<Buffer> sps;
85 List<Buffer> pps;
86
105 static Error fromAnnexB(const BufferView &au, HevcDecoderConfig &out);
106
113 static Error parse(const BufferView &payload, HevcDecoderConfig &out);
114
116 Error serialize(Buffer &outBuf) const;
117
123 Error toAnnexB(Buffer &outBuf) const;
124
138 static bool isIrapAnnexB(const BufferView &au);
139
147 struct SpsInfo {
148 uint32_t width = 0;
149 uint32_t height = 0;
150 uint8_t chromaFormatIdc = 1;
151 uint8_t bitDepthLumaMinus8 = 0;
152 uint8_t bitDepthChromaMinus8 = 0;
153 };
154
184 static Error parseSpsResolution(const BufferView &sps, SpsInfo &out);
185};
186
187PROMEKI_NAMESPACE_END
188
189#endif // PROMEKI_ENABLE_PROAV