Go to the documentation of this file.
37 hash_type = bytestream2_get_byte(gb);
39 for (cIdx = 0; cIdx < 3; cIdx++) {
43 }
else if (hash_type == 1) {
45 }
else if (hash_type == 2) {
61 if (
sps->vui.frame_field_info_present_flag) {
64 if (pic_struct == 2 || pic_struct == 10 || pic_struct == 12) {
67 }
else if (pic_struct == 1 || pic_struct == 9 || pic_struct == 11) {
70 }
else if (pic_struct == 7) {
73 }
else if (pic_struct == 8) {
84 int num_sps_ids_minus1;
85 unsigned active_seq_parameter_set_id;
92 if (num_sps_ids_minus1 < 0 || num_sps_ids_minus1 > 15) {
99 av_log(logctx,
AV_LOG_ERROR,
"active_parameter_set_id %d invalid\n", active_seq_parameter_set_id);
102 s->active_seq_parameter_set_id = active_seq_parameter_set_id;
111 for (
int i = 0;
i <
s->num_clock_ts;
i++) {
114 if (
s->clock_timestamp_flag[
i]) {
115 s->units_field_based_flag[
i] =
get_bits(gb, 1);
123 if (
s->full_timestamp_flag[
i]) {
129 if (
s->seconds_flag[
i]) {
132 if (
s->minutes_flag[
i]) {
135 if (
s->hours_flag[
i]) {
143 if (
s->time_offset_length[
i] > 0) {
156 if (
s->prec_ref_display_width > 31)
159 if (
s->ref_viewing_distance_flag) {
161 if (
s->prec_ref_viewing_dist > 31)
165 if (
s->num_ref_displays > 31)
167 s->num_ref_displays += 1;
169 for (
int i = 0;
i <
s->num_ref_displays;
i++) {
173 s->exponent_ref_display_width[
i] =
get_bits(gb, 6);
174 if (
s->exponent_ref_display_width[
i] > 62)
176 else if (!
s->exponent_ref_display_width[
i])
177 length =
FFMAX(0, (
int)
s->prec_ref_display_width - 30);
179 length =
FFMAX(0, (
int)
s->exponent_ref_display_width[
i] +
180 (
int)
s->prec_ref_display_width - 31);
182 if (
s->ref_viewing_distance_flag) {
183 s->exponent_ref_viewing_distance[
i] =
get_bits(gb, 6);
184 if (
s->exponent_ref_viewing_distance[
i] > 62)
186 else if (!
s->exponent_ref_viewing_distance[
i])
187 length =
FFMAX(0, (
int)
s->prec_ref_viewing_dist - 30);
189 length =
FFMAX(0, (
int)
s->exponent_ref_viewing_distance[
i] +
190 (
int)
s->prec_ref_viewing_dist - 31);
193 s->additional_shift_present_flag[
i] =
get_bits1(gb);
194 if (
s->additional_shift_present_flag[
i]) {
196 if (
s->num_sample_shift[
i] > 1023)
198 s->num_sample_shift[
i] -= 512;
201 s->three_dimensional_reference_displays_extension_flag =
get_bits1(gb);
248 int payload_type = 0;
249 int payload_size = 0;
254 while (
byte == 0xFF) {
257 byte = bytestream2_get_byteu(gb);
258 payload_type +=
byte;
261 while (
byte == 0xFF) {
264 byte = bytestream2_get_byteu(gb);
265 payload_size +=
byte;
275 logctx,
s, ps, payload_type);
278 logctx,
s, payload_type);
static int get_bits_left(GetBitContext *gb)
@ AV_PICTURE_STRUCTURE_UNKNOWN
unknown
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static int decode_nal_sei_suffix(GetBitContext *gb, GetByteContext *gbyte, void *logctx, HEVCSEI *s, int type)
static int get_bits_count(const GetBitContext *s)
static int get_ue_golomb(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to 8190.
@ SEI_TYPE_THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO
int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, enum AVCodecID codec_id, GetBitContext *gb, GetByteContext *gbyte, void *logctx)
Decode a single SEI message.
static int decode_nal_sei_message(GetByteContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int nal_unit_type)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
static int decode_nal_sei_timecode(HEVCSEITimeCode *s, GetBitContext *gb)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
const HEVCSPS * sps_list[HEVC_MAX_SPS_COUNT]
RefStruct references.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx)
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
coded as bottom field
@ AV_PICTURE_STRUCTURE_TOP_FIELD
coded as top field
static unsigned int get_bits1(GetBitContext *s)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL byte
@ FF_H2645_SEI_MESSAGE_UNHANDLED
static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx)
#define i(width, name, range_min, range_max)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, GetByteContext *gb)
static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitContext *gb)
@ SEI_TYPE_DECODED_PICTURE_HASH
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ SEI_TYPE_ACTIVE_PARAMETER_SETS
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, enum HEVCNALUnitType type)