Go to the documentation of this file.
40 hash_type = bytestream2_get_byte(gb);
42 for (cIdx = 0; cIdx < 3; cIdx++) {
46 }
else if (hash_type == 1) {
48 }
else if (hash_type == 2) {
64 for (
i = 0;
i < 3;
i++) {
65 s->display_primaries[
i][0] = bytestream2_get_be16u(gb);
66 s->display_primaries[
i][1] = bytestream2_get_be16u(gb);
69 s->white_point[0] = bytestream2_get_be16u(gb);
70 s->white_point[1] = bytestream2_get_be16u(gb);
73 s->max_luminance = bytestream2_get_be32u(gb);
74 s->min_luminance = bytestream2_get_be32u(gb);
91 s->max_content_light_level = bytestream2_get_be16u(gb);
92 s->max_pic_average_light_level = bytestream2_get_be16u(gb);
109 s->content_interpretation_type =
get_bits(gb, 6);
113 s->current_frame_is_frame0_flag =
get_bits1(gb);
126 s->anticlockwise_rotation =
get_bits(gb, 16);
139 if (!ps->
sps_list[
s->active_seq_parameter_set_id])
143 if (
sps->vui.frame_field_info_present_flag) {
146 if (pic_struct == 2 || pic_struct == 10 || pic_struct == 12) {
149 }
else if (pic_struct == 1 || pic_struct == 9 || pic_struct == 11) {
152 }
else if (pic_struct == 7) {
155 }
else if (pic_struct == 8) {
183 if (size < 16 || size >= INT_MAX - 1)
198 s->buf_ref[
s->nb_buf_ref++] = buf_ref;
258 int country_code, provider_code;
263 country_code = bytestream2_get_byteu(gb);
264 if (country_code == 0xFF) {
271 if (country_code != 0xB5 && country_code != 0x26) {
273 "Unsupported User Data Registered ITU-T T35 SEI message (country_code = 0x%x)\n",
278 provider_code = bytestream2_get_be16u(gb);
280 switch (provider_code) {
282 const uint16_t cuva_provider_oriented_code = 0x0005;
283 uint16_t provider_oriented_code;
288 provider_oriented_code = bytestream2_get_be16u(gb);
289 if (provider_oriented_code == cuva_provider_oriented_code) {
296 const uint16_t smpte2094_40_provider_oriented_code = 0x0001;
297 const uint8_t smpte2094_40_application_identifier = 0x04;
298 uint16_t provider_oriented_code;
299 uint8_t application_identifier;
304 provider_oriented_code = bytestream2_get_be16u(gb);
305 application_identifier = bytestream2_get_byteu(gb);
306 if (provider_oriented_code == smpte2094_40_provider_oriented_code &&
307 application_identifier == smpte2094_40_application_identifier) {
313 uint32_t user_identifier;
318 user_identifier = bytestream2_get_be32u(gb);
319 switch (user_identifier) {
320 case MKBETAG(
'G',
'A',
'9',
'4'):
324 "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n",
332 "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n",
342 int num_sps_ids_minus1;
343 unsigned active_seq_parameter_set_id;
350 if (num_sps_ids_minus1 < 0 || num_sps_ids_minus1 > 15) {
357 av_log(logctx,
AV_LOG_ERROR,
"active_parameter_set_id %d invalid\n", active_seq_parameter_set_id);
360 s->active_seq_parameter_set_id = active_seq_parameter_set_id;
372 s->preferred_transfer_characteristics = bytestream2_get_byteu(gb);
381 for (
int i = 0;
i <
s->num_clock_ts;
i++) {
384 if (
s->clock_timestamp_flag[
i]) {
385 s->units_field_based_flag[
i] =
get_bits(gb, 1);
393 if (
s->full_timestamp_flag[
i]) {
399 if (
s->seconds_flag[
i]) {
402 if (
s->minutes_flag[
i]) {
405 if (
s->hours_flag[
i]) {
413 if (
s->time_offset_length[
i] > 0) {
429 memset(
h, 0,
sizeof(*
h));
431 h->separate_colour_description_present_flag =
get_bits1(gb);
432 if (
h->separate_colour_description_present_flag) {
434 h->bit_depth_chroma =
get_bits(gb, 3) + 8;
437 h->transfer_characteristics =
get_bits(gb, 8);
442 for (
int c = 0;
c < 3;
c++)
444 for (
int c = 0;
c < 3;
c++) {
445 if (
h->comp_model_present_flag[
c]) {
446 h->num_intensity_intervals[
c] =
get_bits(gb, 8) + 1;
448 if (
h->num_model_values[
c] > 6)
450 for (
int i = 0;
i <
h->num_intensity_intervals[
c];
i++) {
451 h->intensity_interval_lower_bound[
c][
i] =
get_bits(gb, 8);
452 h->intensity_interval_upper_bound[
c][
i] =
get_bits(gb, 8);
453 for (
int j = 0; j <
h->num_model_values[
c]; j++)
518 int payload_type = 0;
519 int payload_size = 0;
524 while (
byte == 0xFF) {
527 byte = bytestream2_get_byteu(gb);
528 payload_type +=
byte;
531 while (
byte == 0xFF) {
534 byte = bytestream2_get_byteu(gb);
535 payload_size +=
byte;
545 logctx,
s, ps, payload_type);
548 logctx,
s, payload_type);
574 for (
int i = 0;
i <
s->unregistered.nb_buf_ref;
i++)
576 s->unregistered.nb_buf_ref = 0;
static int decode_nal_sei_frame_packing_arrangement(HEVCSEIFramePacking *s, GetBitContext *gb)
@ SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int get_se_golomb_long(GetBitContext *gb)
uint8_t * data
The data buffer.
@ AV_PICTURE_STRUCTURE_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 get_bits_count(const GetBitContext *s)
static int decode_nal_sei_user_data_unregistered(HEVCSEIUnregistered *s, GetByteContext *gb)
static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, GetByteContext *gb)
#define AV_LOG_VERBOSE
Detailed information.
@ SEI_TYPE_USER_DATA_UNREGISTERED
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
@ SEI_TYPE_FRAME_PACKING_ARRANGEMENT
static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type)
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
static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx)
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, enum HEVCNALUnitType type)
#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.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
@ SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
int ff_parse_a53_cc(AVBufferRef **pbuf, const uint8_t *data, int size)
Parse a data array for ATSC A53 Part 4 Closed Captions and store them in an AVBufferRef.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
@ AV_PICTURE_STRUCTURE_TOP_FIELD
static unsigned int get_bits1(GetBitContext *s)
This struct represents dynamic metadata for color volume transform - CUVA 005.1:2021 standard.
static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, GetByteContext *gb)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static int decode_nal_sei_message(GetByteContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int nal_unit_type)
static int decode_nal_sei_alternative_transfer(HEVCSEIAlternativeTransfer *s, GetByteContext *gb)
@ SEI_TYPE_FILM_GRAIN_CHARACTERISTICS
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static int decode_nal_sei_timecode(HEVCSEITimeCode *s, GetBitContext *gb)
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
#define MKBETAG(a, b, c, d)
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
static int decode_film_grain_characteristics(HEVCSEIFilmGrainCharacteristics *h, GetBitContext *gb)
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
static int decode_nal_sei_display_orientation(HEVCSEIDisplayOrientation *s, GetBitContext *gb)
int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t *data, int size)
Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRVivid).
size_t size
Size of data in bytes.
static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetByteContext *gb, void *logctx)
#define i(width, name, range_min, range_max)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
void ff_hevc_reset_sei(HEVCSEI *s)
Reset SEI values that are stored on the Context.
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, GetByteContext *gb)
static int decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s, GetByteContext *gb)
static int decode_registered_user_data_closed_caption(HEVCSEIA53Caption *s, GetByteContext *gb)
int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t *data, int size)
Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus).
AVBufferRef * sps_list[HEVC_MAX_SPS_COUNT]
@ SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
static int decode_nal_sei_suffix(GetBitContext *gb, GetByteContext *gbyte, void *logctx, HEVCSEI *s, int type)
@ SEI_TYPE_ACTIVE_PARAMETER_SETS
A reference to a data buffer.
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
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)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int decode_registered_user_data_dynamic_hdr_vivid(HEVCSEIDynamicHDRVivid *s, GetByteContext *gb)
@ SEI_TYPE_DISPLAY_ORIENTATION
@ SEI_TYPE_DECODED_PICTURE_HASH