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;
171 bits_written = current_position - start_position;
174 bits_written < 8 * current->payload_size) {
181 bits_left = 8 * current->payload_size - bits_written;
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++) {
201 int length =
FFMIN(bits_left, 8);
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;
244 fixed(8, ff_byte, 0xff);
247 xu(8, last_payload_type_byte,
tmp, 0, 254, 0);
251 fixed(8, ff_byte, 0xff);
254 xu(8, last_payload_size_byte,
tmp, 0, 254, 0);
261 "Invalid SEI message: payload_size too large "
262 "(%"PRIu32
" bytes).\n", payload_size);
270 message = ¤t->messages[k];
272 message->payload_type = payload_type;
273 message->payload_size = payload_size;
283 for (k = 0; k < current->nb_messages; k++) {
288 message = ¤t->messages[k];
292 trace =
ctx->trace_enable;
293 ctx->trace_enable = 0;
296 for (
i = 0;
i < 2;
i++) {
301 fixed(8, ff_byte, 0xff);
304 xu(8, last_payload_type_byte,
tmp, 0, 254, 0);
308 fixed(8, ff_byte, 0xff);
311 xu(8, last_payload_size_byte,
tmp, 0, 254, 0);
314 ctx->trace_enable = trace;