36 #define AVERROR_PS_NOT_FOUND FFERRTAG(0xF8,'?','P','S') 39 1, 1, 1, 2, 2, 3, 3, 2, 3
75 unsigned int i, num_clock_ts;
85 for (i = 0; i < num_clock_ts; i++) {
88 unsigned int full_timestamp_flag;
89 unsigned int counting_type, cnt_dropped_flag;
93 full_timestamp_flag =
get_bits(&gb, 1);
96 if (cnt_dropped_flag && counting_type > 1 && counting_type < 7)
99 if (full_timestamp_flag) {
134 int size = (size_bits + 7) / 8;
140 if (size >
sizeof(h->
payload)) {
184 void *logctx,
int size)
186 int country_code, provider_code;
193 if (country_code == 0xFF) {
201 if (country_code != 0xB5) {
203 "Unsupported User Data Registered ITU-T T35 SEI message (country_code = %d)\n",
211 switch (provider_code) {
213 uint32_t user_identifier;
220 switch (user_identifier) {
221 case MKBETAG(
'D',
'T',
'G',
'1'):
223 case MKBETAG(
'G',
'A',
'9',
'4'):
228 "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n",
236 "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n",
245 void *logctx,
int size)
262 user_data = buf_ref->
data;
264 for (i = 0; i <
size; i++)
271 e = sscanf(user_data + 16,
"x264 - core %d", &build);
272 if (e == 1 && build > 0)
274 if (e == 1 && build == 1 && !strncmp(user_data+16,
"x264 - core 0000", 16))
285 av_log(logctx,
AV_LOG_ERROR,
"recovery_frame_cnt %u is out of range\n", recovery_frame_cnt);
306 if (sps_id > 31 || !ps->
sps_list[sps_id]) {
308 "non-existing SPS %d referenced in buffering period\n", sps_id);
315 for (sched_sel_idx = 0; sched_sel_idx < sps->
cpb_cnt; sched_sel_idx++) {
323 for (sched_sel_idx = 0; sched_sel_idx < sps->
cpb_cnt; sched_sel_idx++) {
499 return "checkerboard_rl";
501 return "checkerboard_lr";
504 return "col_interleaved_rl";
506 return "col_interleaved_lr";
509 return "row_interleaved_rl";
511 return "row_interleaved_lr";
static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb, void *logctx)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
int recovery_frame_cnt
recovery_frame_cnt
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
AVBufferRef * sps_list[MAX_SPS_COUNT]
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
H264SEIAlternativeTransfer alternative_transfer
void ff_h264_sei_uninit(H264SEIContext *h)
Reset SEI values at the beginning of the frame.
H264SEIDisplayOrientation display_orientation
int current_frame_is_frame0_flag
H264SEIGreenMetaData green_metadata
const char * ff_h264_sei_stereo_mode(const H264SEIFramePacking *h)
Get stereo_mode string from the h264 frame_packing_arrangement.
int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS *sps, void *logctx)
Parse the contents of a picture timing message given an active SPS.
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 decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *gb, void *logctx, int size)
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
#define AV_LOG_VERBOSE
Detailed information.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
int timecode_cnt
Number of timecode in use.
static int get_bits_left(GetBitContext *gb)
H.264 parameter set handling.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int preferred_transfer_characteristics
H264_SEI_FpaType arrangement_type
int present
Buffering period SEI flag.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int arrangement_repetition_period
H264SEIUnregistered unregistered
static int decode_registered_user_data_afd(H264SEIAFD *h, GetBitContext *gb, int size)
uint8_t active_format_description
static int decode_display_orientation(H264SEIDisplayOrientation *h, GetBitContext *gb)
H264_SEI_PicStructType pic_struct
int initial_cpb_removal_delay_length
initial_cpb_removal_delay_length_minus1 + 1
int ct_type
Bit set of clock types for fields/frames in picture timing SEI message.
static int FUNC() user_data(CodedBitstreamContext *ctx, RWContext *rw, MPEG2RawUserData *current)
int initial_cpb_removal_delay[32]
Initial timestamps for CPBs.
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static int decode_recovery_point(H264SEIRecoveryPoint *h, GetBitContext *gb, void *logctx)
int cpb_removal_delay
cpb_removal_delay in picture timing SEI message, see H.264 C.1.2
int quincunx_sampling_flag
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
int vcl_hrd_parameters_present_flag
Libavcodec external API header.
static int get_ue_golomb_31(GetBitContext *gb)
read unsigned exp golomb code, constraint to a max of 31.
AVBufferRef * av_buffer_alloc(buffer_size_t size)
Allocate an AVBuffer of the given size using av_malloc().
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
int dpb_output_delay_length
dpb_output_delay_length_minus1 + 1
uint8_t * data
The data buffer.
H264SEITimeCode timecode[3]
Maximum three timecodes in a pic_timing SEI.
H264SEIA53Caption a53_caption
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static int decode_alternative_transfer(H264SEIAlternativeTransfer *h, GetBitContext *gb)
int content_interpretation_type
H264SEIBufferingPeriod buffering_period
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
#define AVERROR_PS_NOT_FOUND
H264SEIPictureTiming picture_timing
H264SEIRecoveryPoint recovery_point
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static const uint8_t sei_num_clock_ts_table[9]
int size
Size of data in bytes.
int pic_struct_present_flag
static int decode_frame_packing_arrangement(H264SEIFramePacking *h, GetBitContext *gb)
#define MAX_LOG2_MAX_FRAME_NUM
A reference to a data buffer.
int anticlockwise_rotation
common internal api header.
int dpb_output_delay
dpb_output_delay in picture timing SEI message, see H.264 C.2.2
int nal_hrd_parameters_present_flag
H264SEIFramePacking frame_packing
#define MKBETAG(a, b, c, d)
int cpb_cnt
See H.264 E.1.2.
int ff_h264_sei_decode(H264SEIContext *h, GetBitContext *gb, const H264ParamSets *ps, void *logctx)
static int decode_registered_user_data(H264SEIContext *h, GetBitContext *gb, void *logctx, int size)
int cpb_removal_delay_length
cpb_removal_delay_length_minus1 + 1
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 decode_green_metadata(H264SEIGreenMetaData *h, GetBitContext *gb)
static int decode_registered_user_data_closed_caption(H264SEIA53Caption *h, GetBitContext *gb, void *logctx, int size)
int arrangement_cancel_flag
is previous arrangement canceled, -1 if never received
static int decode_buffering_period(H264SEIBufferingPeriod *h, GetBitContext *gb, const H264ParamSets *ps, void *logctx)