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);
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");
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");
86 for (
i = 0;
i < 16;
i++)
87 us(8, uuid_iso_iec_11578[
i], 0x00, 0xff, 1,
i);
92 xu(8, user_data_payload_byte[
i], current->
data[
i], 0x00, 0xff, 1,
i);
103 HEADER(
"Frame Packing Arrangement");
106 flag(fp_arrangement_cancel_flag);
108 u(7, fp_arrangement_type, 3, 5);
109 flag(fp_quincunx_sampling_flag);
110 u(6, fp_content_interpretation_type, 0, 2);
111 flag(fp_spatial_flipping_flag);
112 flag(fp_frame0_flipped_flag);
113 flag(fp_field_views_flag);
114 flag(fp_current_frame_is_frame0_flag);
115 flag(fp_frame0_self_contained_flag);
116 flag(fp_frame1_self_contained_flag);
118 ub(4, fp_frame0_grid_position_x);
119 ub(4, fp_frame0_grid_position_y);
120 ub(4, fp_frame1_grid_position_x);
121 ub(4, fp_frame1_grid_position_y);
123 fixed(8, fp_arrangement_reserved_byte, 0);
124 flag(fp_arrangement_persistence_flag);
126 flag(fp_upsampled_aspect_ratio_flag);
138 HEADER(
"Decoded Picture Hash");
140 u(8, dph_sei_hash_type, 0, 2);
141 flag(dph_sei_single_component_flag);
142 ub(7, dph_sei_reserved_zero_7bits);
147 for (
i = 0;
i < 16;
i++)
148 us(8, dph_sei_picture_md5[c_idx][
i], 0x00, 0xff, 2, c_idx,
i);
150 us(16, dph_sei_picture_crc[c_idx], 0x0000, 0xffff, 1, c_idx);
152 us(32, dph_sei_picture_checksum[c_idx], 0x00000000, 0xffffffff, 1,
166 HEADER(
"Mastering Display Colour Volume");
168 for (
c = 0;
c < 3;
c++) {
169 ubs(16, display_primaries_x[
c], 1,
c);
170 ubs(16, display_primaries_y[
c], 1,
c);
173 ub(16, white_point_x);
174 ub(16, white_point_y);
176 ub(32, max_display_mastering_luminance);
177 ub(32, min_display_mastering_luminance);
188 HEADER(
"Content Light Level Information");
190 ub(16, max_content_light_level);
191 ub(16, max_pic_average_light_level);
203 HEADER(
"Alternative Transfer Characteristics");
205 ub(8, preferred_transfer_characteristics);
215 static const uint16_t max_ambient_light_value = 50000;
218 HEADER(
"Ambient Viewing Environment");
221 u(16, ambient_light_x, 0, max_ambient_light_value);
222 u(16, ambient_light_y, 0, max_ambient_light_value);
236 .payload_type = current->payload_type,
237 .payload_size = current->payload_size,
238 .extension_present = current->extension_bit_length > 0,
240 int start_position, current_position, bits_written;
251 bits_written = current_position - start_position;
254 bits_written < 8 * current->payload_size) {
261 bits_left = 8 * current->payload_size - bits_written;
271 current->extension_bit_length =
275 if (current->extension_bit_length > 0) {
277 (current->extension_bit_length + 7) / 8);
279 bits_left = current->extension_bit_length;
282 xu(length, reserved_payload_extension_data,
283 current->extension_data[
i],
289 fixed(1, bit_equal_to_one, 1);
291 fixed(1, bit_equal_to_zero, 0);
295 current->payload_size = (
put_bits_count(rw) - start_position) / 8;
301 allocate(current->payload_ref, current->payload_size);
302 current->payload = current->payload_ref;
304 allocate(current->payload, current->payload_size);
306 data = current->payload;
308 for (
i = 0;
i < current->payload_size;
i++)
309 xu(8, payload_byte[
i],
data[
i], 0, 255, 1,
i);
323 uint32_t payload_type = 0;
324 uint32_t payload_size = 0;
329 fixed(8, ff_byte, 0xff);
332 xu(8, last_payload_type_byte,
tmp, 0, 254, 0);
336 fixed(8, ff_byte, 0xff);
339 xu(8, last_payload_size_byte,
tmp, 0, 254, 0);
346 "Invalid SEI message: payload_size too large "
347 "(%"PRIu32
" bytes).\n", payload_size);
355 message = ¤t->messages[k];
357 message->payload_type = payload_type;
358 message->payload_size = payload_size;
368 for (k = 0; k < current->nb_messages; k++) {
373 message = ¤t->messages[k];
377 trace =
ctx->trace_enable;
378 ctx->trace_enable = 0;
381 for (
i = 0;
i < 2;
i++) {
386 fixed(8, ff_byte, 0xff);
389 xu(8, last_payload_type_byte,
tmp, 0, 254, 0);
393 fixed(8, ff_byte, 0xff);
396 xu(8, last_payload_size_byte,
tmp, 0, 254, 0);
399 ctx->trace_enable = trace;