39 for (cIdx = 0; cIdx < 3; cIdx++) {
42 for (
i = 0;
i < 16;
i++)
44 }
else if (hash_type == 1) {
47 }
else if (hash_type == 2) {
63 for (
i = 0;
i < 3;
i++) {
91 s->max_content_light_level =
get_bits(gb, 16);
92 s->max_pic_average_light_level =
get_bits(gb, 16);
111 s->content_interpretation_type =
get_bits(gb, 6);
115 s->current_frame_is_frame0_flag =
get_bits1(gb);
119 if (!
s->quincunx_subsampling &&
s->arrangement_type != 5)
136 s->anticlockwise_rotation =
get_bits(gb, 16);
144 void *logctx,
int size)
149 if (!ps->
sps_list[
s->active_seq_parameter_set_id])
153 if (
sps->vui.frame_field_info_present_flag) {
156 if (pic_struct == 2 || pic_struct == 10 || pic_struct == 12) {
159 }
else if (pic_struct == 1 || pic_struct == 9 || pic_struct == 11) {
162 }
else if (pic_struct == 7) {
165 }
else if (pic_struct == 8) {
202 if (size < 16 || size >= INT_MAX - 1)
218 s->buf_ref[
s->nb_buf_ref++] = buf_ref;
252 void *logctx,
int size)
254 int country_code, provider_code;
261 if (country_code == 0xFF) {
269 if (country_code != 0xB5) {
271 "Unsupported User Data Registered ITU-T T35 SEI message (country_code = %d)\n",
278 switch (provider_code) {
281 const uint16_t smpte2094_40_provider_oriented_code = 0x0001;
282 const uint8_t smpte2094_40_application_identifier = 0x04;
283 uint16_t provider_oriented_code;
284 uint8_t application_identifier;
290 provider_oriented_code =
get_bits(gb, 16);
291 application_identifier =
get_bits(gb, 8);
292 if (provider_oriented_code == smpte2094_40_provider_oriented_code &&
293 application_identifier == smpte2094_40_application_identifier) {
299 uint32_t user_identifier;
306 switch (user_identifier) {
307 case MKBETAG(
'G',
'A',
'9',
'4'):
311 "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n",
319 "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n",
331 int num_sps_ids_minus1;
333 unsigned active_seq_parameter_set_id;
340 if (num_sps_ids_minus1 < 0 || num_sps_ids_minus1 > 15) {
347 av_log(logctx,
AV_LOG_ERROR,
"active_parameter_set_id %d invalid\n", active_seq_parameter_set_id);
350 s->active_seq_parameter_set_id = active_seq_parameter_set_id;
352 for (
i = 1;
i <= num_sps_ids_minus1;
i++)
364 s->preferred_transfer_characteristics =
get_bits(gb, 8);
375 for (
int i = 0;
i <
s->num_clock_ts;
i++) {
378 if (
s->clock_timestamp_flag[
i]) {
379 s->units_field_based_flag[
i] =
get_bits(gb, 1);
387 if (
s->full_timestamp_flag[
i]) {
393 if (
s->seconds_flag[
i]) {
396 if (
s->minutes_flag[
i]) {
399 if (
s->hours_flag[
i]) {
407 if (
s->time_offset_length[
i] > 0) {
467 int payload_type = 0;
468 int payload_size = 0;
472 while (
byte == 0xFF) {
476 payload_type += byte;
479 while (
byte == 0xFF) {
483 payload_size += byte;
516 for (
int i = 0;
i <
s->unregistered.nb_buf_ref;
i++)
518 s->unregistered.nb_buf_ref = 0;
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.
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
#define MKBETAG(a, b, c, d)
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).
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int get_bits_left(GetBitContext *gb)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int get_bits_count(const GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
@ AV_PICTURE_STRUCTURE_TOP_FIELD
@ AV_PICTURE_STRUCTURE_UNKNOWN
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_create(uint8_t *data, buffer_size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVBufferRef * av_buffer_alloc(buffer_size_t size)
Allocate an AVBuffer of the given size using av_malloc().
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, GetBitContext *gb, int size)
static int more_rbsp_data(GetBitContext *gb)
static int decode_nal_sei_user_data_unregistered(HEVCSEIUnregistered *s, GetBitContext *gb, int size)
static int decode_nal_sei_alternative_transfer(HEVCSEIAlternativeTransfer *s, GetBitContext *gb, int size)
static int decode_registered_user_data_closed_caption(HEVCSEIA53Caption *s, GetBitContext *gb, int size)
static int decode_nal_sei_frame_packing_arrangement(HEVCSEIFramePacking *s, GetBitContext *gb)
static int decode_nal_sei_suffix(GetBitContext *gb, void *logctx, HEVCSEI *s, int type, int size)
static int decode_nal_sei_message(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int nal_unit_type)
static int decode_nal_sei_timecode(HEVCSEITimeCode *s, GetBitContext *gb)
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type)
static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitContext *gb, void *logctx, int size)
static int decode_nal_sei_display_orientation(HEVCSEIDisplayOrientation *s, GetBitContext *gb)
void ff_hevc_reset_sei(HEVCSEI *s)
Reset SEI values that are stored on the Context.
static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx, int size)
static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, GetBitContext *gb)
static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx)
static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, GetBitContext *gb, int size)
static int decode_nal_sei_prefix(GetBitContext *gb, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type, int size)
static int decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s, GetBitContext *gb, int size)
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
@ SEI_TYPE_DECODED_PICTURE_HASH
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
@ SEI_TYPE_ACTIVE_PARAMETER_SETS
@ SEI_TYPE_DISPLAY_ORIENTATION
@ SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS
@ SEI_TYPE_FRAME_PACKING_ARRANGEMENT
@ SEI_TYPE_USER_DATA_UNREGISTERED
@ SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO
@ SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
A reference to a data buffer.
int size
Size of data in bytes.
uint8_t * data
The data buffer.
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
AVBufferRef * sps_list[HEVC_MAX_SPS_COUNT]