28 current->payload_size =
state->payload_size;
31 for (i = 0; i < current->payload_size; i++)
32 fixed(8, ff_byte, 0xff);
43 HEADER(
"User Data Registered ITU-T T.35");
45 u(8, itu_t_t35_country_code, 0x00, 0xff);
46 if (current->itu_t_t35_country_code != 0xff)
49 u(8, itu_t_t35_country_code_extension_byte, 0x00, 0xff);
54 if (
state->payload_size < i) {
56 "Invalid SEI user data registered payload.\n");
59 current->data_length =
state->payload_size -
i;
62 allocate(current->data, current->data_length);
63 for (j = 0; j < current->data_length; j++)
64 xu(8, itu_t_t35_payload_byte[], current->data[j], 0x00, 0xff, 1, i + j);
75 HEADER(
"User Data Unregistered");
78 if (
state->payload_size < 16) {
80 "Invalid SEI user data unregistered payload.\n");
83 current->data_length =
state->payload_size - 16;
86 for (i = 0; i < 16; i++)
87 us(8, uuid_iso_iec_11578[i], 0x00, 0xff, 1, i);
89 allocate(current->data, current->data_length);
91 for (i = 0; i < current->data_length; i++)
92 xu(8, user_data_payload_byte[i], current->data[i], 0x00, 0xff, 1, i);
103 HEADER(
"Mastering Display Colour Volume");
105 for (c = 0; c < 3; c++) {
106 ubs(16, display_primaries_x[c], 1, c);
107 ubs(16, display_primaries_y[c], 1, c);
110 ub(16, white_point_x);
111 ub(16, white_point_y);
113 ub(32, max_display_mastering_luminance);
114 ub(32, min_display_mastering_luminance);
125 HEADER(
"Content Light Level Information");
127 ub(16, max_content_light_level);
128 ub(16, max_pic_average_light_level);
140 HEADER(
"Alternative Transfer Characteristics");
142 ub(8, preferred_transfer_characteristics);
156 .payload_type = current->payload_type,
157 .payload_size = current->payload_size,
158 .extension_present = current->extension_bit_length > 0,
160 int start_position, current_position, bits_written;
168 CHECK(desc->READWRITE(ctx, rw, current->payload, &state));
171 bits_written = current_position - start_position;
174 bits_written < 8 * current->payload_size) {
181 bits_left = 8 * current->payload_size - bits_written;
185 if (trailing_bits == 0) {
190 trailing_zero_bits =
ff_ctz(trailing_bits);
191 current->extension_bit_length =
192 bits_left - 1 - trailing_zero_bits;
195 if (current->extension_bit_length > 0) {
197 (current->extension_bit_length + 7) / 8);
199 bits_left = current->extension_bit_length;
200 for (i = 0; bits_left > 0; i++) {
202 xu(length, reserved_payload_extension_data,
203 current->extension_data[i],
209 fixed(1, bit_equal_to_one, 1);
211 fixed(1, bit_equal_to_zero, 0);
215 current->payload_size = (
put_bits_count(rw) - start_position) / 8;
220 allocate(current->payload, current->payload_size);
221 data = current->payload;
223 for (i = 0; i < current->payload_size; i++)
224 xu(8, payload_byte[i], data[i], 0, 255, 1, i);
238 uint32_t payload_type = 0;
239 uint32_t payload_size = 0;
243 fixed(8, ff_byte, 0xff);
246 xu(8, last_payload_type_byte, tmp, 0, 254, 0);
250 fixed(8, ff_byte, 0xff);
253 xu(8, last_payload_size_byte, tmp, 0, 254, 0);
257 message = ¤t->messages[k];
268 for (k = 0; k < current->nb_messages; k++) {
273 message = ¤t->messages[k];
281 for (i = 0; i < 2; i++) {
286 fixed(8, ff_byte, 0xff);
289 xu(8, last_payload_type_byte, tmp, 0, 254, 0);
293 fixed(8, ff_byte, 0xff);
296 xu(8, last_payload_size_byte, tmp, 0, 254, 0);
#define allocate(name, size)
static int FUNC() trailing_bits(CodedBitstreamContext *ctx, RWContext *rw, int nb_bits)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
#define fixed(width, name, value)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static int FUNC() user_data_registered(CodedBitstreamContext *ctx, RWContext *rw, SEIRawUserDataRegistered *current, SEIMessageState *state)
static int FUNC() message_list(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessageList *current, int prefix)
uint8_t extension_present
#define us(width, name, range_min, range_max, subs,...)
static int FUNC() alternative_transfer_characteristics(CodedBitstreamContext *ctx, RWContext *rw, SEIRawAlternativeTransferCharacteristics *current, SEIMessageState *state)
static int FUNC() user_data_unregistered(CodedBitstreamContext *ctx, RWContext *rw, SEIRawUserDataUnregistered *current, SEIMessageState *state)
int trace_enable
Enable trace output during read/write operations.
#define byte_alignment(rw)
const SEIMessageTypeDescriptor * ff_cbs_sei_find_type(CodedBitstreamContext *ctx, int payload_type)
Find the type descriptor for the given payload type.
#define MAX_UINT_BITS(length)
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
#define u(width, name, range_min, range_max)
CHECK(-1) CHECK(-2)}}}}CHECK(1) CHECK(2)}}}}}if(diff0+diff1 > 0) temp-
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int put_bits_count(PutBitContext *s)
void * log_ctx
Logging context to be passed to all av_log() calls associated with this context.
static int FUNC() mastering_display_colour_volume(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMasteringDisplayColourVolume *current, SEIMessageState *state)
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static int FUNC() message(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current)
#define xu(width, name, var, range_min, range_max, subs,...)
int ff_cbs_sei_list_add(SEIRawMessageList *list)
Allocate a new empty SEI message in a message list.
Context structure for coded bitstream operations.
static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
static int FUNC() filler_payload(CodedBitstreamContext *ctx, RWContext *rw, SEIRawFillerPayload *current, SEIMessageState *state)
#define ubs(width, name, subs,...)
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.
static int FUNC() content_light_level_info(CodedBitstreamContext *ctx, RWContext *rw, SEIRawContentLightLevelInfo *current, SEIMessageState *state)