FFmpeg
Loading...
Searching...
No Matches
cbs_sei.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavutil/mem.h"
20#include "cbs.h"
21#include "cbs_internal.h"
22#include "cbs_h264.h"
23#include "cbs_h265.h"
24#include "cbs_h266.h"
25#include "cbs_sei.h"
26#include "libavutil/refstruct.h"
27
28#define HEADER(name) do { \
29 ff_cbs_trace_header(ctx, name); \
30 } while (0)
31
32#define CHECK(call) do { \
33 err = (call); \
34 if (err < 0) \
35 return err; \
36 } while (0)
37
38#define FUNC_NAME2(rw, codec, name) cbs_ ## codec ## _ ## rw ## _ ## name
39#define FUNC_NAME1(rw, codec, name) FUNC_NAME2(rw, codec, name)
40#define FUNC_NAME2_EXPORT(rw, codec, name) ff_cbs_ ## codec ## _ ## rw ## _ ## name
41#define FUNC_NAME1_EXPORT(rw, codec, name) FUNC_NAME2_EXPORT(rw, codec, name)
42#define FUNC_SEI(name) FUNC_NAME1(READWRITE, sei, name)
43#define FUNC_SEI_EXPORT(name) FUNC_NAME1_EXPORT(READWRITE, sei, name)
44
45#define SEI_FUNC(name, args) \
46static int FUNC_SEI(name) args; \
47static int FUNC_SEI(name ## _internal)(CodedBitstreamContext *ctx, \
48 RWContext *rw, void *cur, \
49 SEIMessageState *state) \
50{ \
51 return FUNC_SEI(name)(ctx, rw, cur, state); \
52} \
53static int FUNC_SEI(name) args
54
55#define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
56
57#define u(width, name, range_min, range_max) \
58 xu(width, name, current->name, range_min, range_max, 0, )
59#define flag(name) ub(1, name)
60#define ue(name, range_min, range_max) \
61 xue(name, current->name, range_min, range_max, 0, )
62#define i(width, name, range_min, range_max) \
63 xi(width, name, current->name, range_min, range_max, 0, )
64#define ib(width, name) \
65 xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), 0, )
66#define se(name, range_min, range_max) \
67 xse(name, current->name, range_min, range_max, 0, )
68
69#define us(width, name, range_min, range_max, subs, ...) \
70 xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
71#define ubs(width, name, subs, ...) \
72 xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
73#define flags(name, subs, ...) \
74 xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)
75#define ues(name, range_min, range_max, subs, ...) \
76 xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)
77#define is(width, name, range_min, range_max, subs, ...) \
78 xi(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
79#define ibs(width, name, subs, ...) \
80 xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), subs, __VA_ARGS__)
81#define ses(name, range_min, range_max, subs, ...) \
82 xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)
83
84#define fixed(width, name, value) do { \
85 av_unused uint32_t fixed_value = value; \
86 xu(width, name, fixed_value, value, value, 0, ); \
87 } while (0)
88
89
90#define READ
91#define READWRITE read
92#define RWContext GetBitContext
93
94#define ub(width, name) do { \
95 uint32_t value; \
96 CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \
97 &value)); \
98 current->name = value; \
99 } while (0)
100#define xu(width, name, var, range_min, range_max, subs, ...) do { \
101 uint32_t value; \
102 CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \
103 SUBSCRIPTS(subs, __VA_ARGS__), \
104 &value, range_min, range_max)); \
105 var = value; \
106 } while (0)
107#define xue(name, var, range_min, range_max, subs, ...) do { \
108 uint32_t value; \
109 CHECK(ff_cbs_read_ue_golomb(ctx, rw, #name, \
110 SUBSCRIPTS(subs, __VA_ARGS__), \
111 &value, range_min, range_max)); \
112 var = value; \
113 } while (0)
114#define xi(width, name, var, range_min, range_max, subs, ...) do { \
115 int32_t value; \
116 CHECK(ff_cbs_read_signed(ctx, rw, width, #name, \
117 SUBSCRIPTS(subs, __VA_ARGS__), \
118 &value, range_min, range_max)); \
119 var = value; \
120 } while (0)
121#define xse(name, var, range_min, range_max, subs, ...) do { \
122 int32_t value; \
123 CHECK(ff_cbs_read_se_golomb(ctx, rw, #name, \
124 SUBSCRIPTS(subs, __VA_ARGS__), \
125 &value, range_min, range_max)); \
126 var = value; \
127 } while (0)
128
129
130#define infer(name, value) do { \
131 current->name = value; \
132 } while (0)
133
134#define more_rbsp_data(var) ((var) = ff_cbs_h2645_read_more_rbsp_data(rw))
135
136#define bit_position(rw) (get_bits_count(rw))
137#define byte_alignment(rw) (get_bits_count(rw) % 8)
138
139/* The CBS SEI code uses the refstruct API for the allocation
140 * of its child buffers. */
141#define allocate(name, size) do { \
142 name = av_refstruct_allocz(size + \
143 AV_INPUT_BUFFER_PADDING_SIZE); \
144 if (!name) \
145 return AVERROR(ENOMEM); \
146 } while (0)
147
148#define FUNC(name) FUNC_SEI_EXPORT(name)
150#undef FUNC
151
152#undef READ
153#undef READWRITE
154#undef RWContext
155#undef ub
156#undef xu
157#undef xi
158#undef xue
159#undef xse
160#undef infer
161#undef more_rbsp_data
162#undef bit_position
163#undef byte_alignment
164#undef allocate
165
166
167#define WRITE
168#define READWRITE write
169#define RWContext PutBitContext
170
171#define ub(width, name) do { \
172 uint32_t value = current->name; \
173 CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \
174 value)); \
175 } while (0)
176#define xu(width, name, var, range_min, range_max, subs, ...) do { \
177 uint32_t value = var; \
178 CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \
179 SUBSCRIPTS(subs, __VA_ARGS__), \
180 value, range_min, range_max)); \
181 } while (0)
182#define xue(name, var, range_min, range_max, subs, ...) do { \
183 uint32_t value = var; \
184 CHECK(ff_cbs_write_ue_golomb(ctx, rw, #name, \
185 SUBSCRIPTS(subs, __VA_ARGS__), \
186 value, range_min, range_max)); \
187 } while (0)
188#define xi(width, name, var, range_min, range_max, subs, ...) do { \
189 int32_t value = var; \
190 CHECK(ff_cbs_write_signed(ctx, rw, width, #name, \
191 SUBSCRIPTS(subs, __VA_ARGS__), \
192 value, range_min, range_max)); \
193 } while (0)
194#define xse(name, var, range_min, range_max, subs, ...) do { \
195 int32_t value = var; \
196 CHECK(ff_cbs_write_se_golomb(ctx, rw, #name, \
197 SUBSCRIPTS(subs, __VA_ARGS__), \
198 value, range_min, range_max)); \
199 } while (0)
200
201#define infer(name, value) do { \
202 if (current->name != (value)) { \
203 av_log(ctx->log_ctx, AV_LOG_ERROR, \
204 "%s does not match inferred value: " \
205 "%"PRId64", but should be %"PRId64".\n", \
206 #name, (int64_t)current->name, (int64_t)(value)); \
207 return AVERROR_INVALIDDATA; \
208 } \
209 } while (0)
210
211#define more_rbsp_data(var) (var)
212
213#define bit_position(rw) (put_bits_count(rw))
214#define byte_alignment(rw) (put_bits_count(rw) % 8)
215
216#define allocate(name, size) do { \
217 if (!name) { \
218 av_log(ctx->log_ctx, AV_LOG_ERROR, "%s must be set " \
219 "for writing.\n", #name); \
220 return AVERROR_INVALIDDATA; \
221 } \
222 } while (0)
223
224#define FUNC(name) FUNC_SEI_EXPORT(name)
226#undef FUNC
227
233
239
242{
243 void (*free_func)(AVRefStructOpaque, void*);
244
245 av_assert0(message->payload == NULL &&
246 message->payload_ref == NULL);
247 message->payload_type = desc->type;
248
251 else if (desc->type == SEI_TYPE_USER_DATA_UNREGISTERED)
253 else {
254 free_func = NULL;
255 }
256
257 message->payload_ref = av_refstruct_alloc_ext(desc->size, 0,
258 NULL, free_func);
259 if (!message->payload_ref)
260 return AVERROR(ENOMEM);
261 message->payload = message->payload_ref;
262
263 return 0;
264}
265
267{
268 void *ptr;
269 int old_count = list->nb_messages_allocated;
270
271 av_assert0(list->nb_messages <= old_count);
272 if (list->nb_messages + 1 > old_count) {
273 int new_count = 2 * old_count + 1;
274
275 ptr = av_realloc_array(list->messages,
276 new_count, sizeof(*list->messages));
277 if (!ptr)
278 return AVERROR(ENOMEM);
279
280 list->messages = ptr;
281 list->nb_messages_allocated = new_count;
282 }
283 memset(&list->messages[list->nb_messages], 0, sizeof(*list->messages));
284 ++list->nb_messages;
285 return 0;
286}
287
289{
290 for (int i = 0; i < list->nb_messages; i++) {
291 SEIRawMessage *message = &list->messages[i];
292 av_refstruct_unref(&message->payload_ref);
293 av_refstruct_unref(&message->extension_data);
294 }
295 av_free(list->messages);
296}
297
300 int prefix,
301 CodedBitstreamUnit **sei_unit)
302{
303 CodedBitstreamUnit *unit;
304 int sei_type, highest_vcl_type, err, i, position;
305
306 switch (ctx->codec->codec_id) {
307 case AV_CODEC_ID_H264:
308 // (We can ignore auxiliary slices because we only have prefix
309 // SEI in H.264 and an auxiliary picture must always follow a
310 // primary picture.)
311 highest_vcl_type = H264_NAL_IDR_SLICE;
312 if (prefix)
313 sei_type = H264_NAL_SEI;
314 else
315 return AVERROR(EINVAL);
316 break;
317 case AV_CODEC_ID_H265:
318 highest_vcl_type = HEVC_NAL_RSV_VCL31;
319 if (prefix)
320 sei_type = HEVC_NAL_SEI_PREFIX;
321 else
322 sei_type = HEVC_NAL_SEI_SUFFIX;
323 break;
324 case AV_CODEC_ID_H266:
325 highest_vcl_type = VVC_RSV_IRAP_11;
326 if (prefix)
327 sei_type = VVC_PREFIX_SEI_NUT;
328 else
329 sei_type = VVC_SUFFIX_SEI_NUT;
330 break;
331 default:
332 return AVERROR(EINVAL);
333 }
334
335 // Find an existing SEI NAL unit of the right type.
336 unit = NULL;
337 for (i = 0; i < au->nb_units; i++) {
338 if (au->units[i].type == sei_type) {
339 unit = &au->units[i];
340 break;
341 }
342 }
343
344 if (unit) {
345 *sei_unit = unit;
346 return 0;
347 }
348
349 // Need to add a new SEI NAL unit ...
350 if (prefix) {
351 // ... before the first VCL NAL unit.
352 for (i = 0; i < au->nb_units; i++) {
353 if (au->units[i].type < highest_vcl_type)
354 break;
355 }
356 position = i;
357 } else {
358 // ... after the last VCL NAL unit.
359 for (i = au->nb_units - 1; i >= 0; i--) {
360 if (au->units[i].type < highest_vcl_type)
361 break;
362 }
363 if (i < 0) {
364 // No VCL units; just put it at the end.
365 position = au->nb_units;
366 } else {
367 position = i + 1;
368 }
369 }
370
371 err = ff_cbs_insert_unit_content(au, position, sei_type,
372 NULL, NULL);
373 if (err < 0)
374 return err;
375 unit = &au->units[position];
376 unit->type = sei_type;
377
378 err = ff_cbs_alloc_unit_content(ctx, unit);
379 if (err < 0)
380 return err;
381
382 switch (ctx->codec->codec_id) {
383 case AV_CODEC_ID_H264:
384 {
385 H264RawSEI sei = {
386 .nal_unit_header = {
387 .nal_ref_idc = 0,
388 .nal_unit_type = sei_type,
389 },
390 };
391 memcpy(unit->content, &sei, sizeof(sei));
392 }
393 break;
394 case AV_CODEC_ID_H265:
395 {
396 H265RawSEI sei = {
397 .nal_unit_header = {
398 .nal_unit_type = sei_type,
399 .nuh_layer_id = 0,
400 .nuh_temporal_id_plus1 = 1,
401 },
402 };
403 memcpy(unit->content, &sei, sizeof(sei));
404 }
405 break;
406 case AV_CODEC_ID_H266:
407 {
408 H266RawSEI sei = {
409 .nal_unit_header = {
410 .nal_unit_type = sei_type,
411 .nuh_layer_id = 0,
412 .nuh_temporal_id_plus1 = 1,
413 },
414 };
415 memcpy(unit->content, &sei, sizeof(sei));
416 }
417 break;
418 default:
419 av_assert0(0);
420 }
421
422 *sei_unit = unit;
423 return 0;
424}
425
427 CodedBitstreamUnit *unit,
429{
430 switch (ctx->codec->codec_id) {
431 case AV_CODEC_ID_H264:
432 {
433 H264RawSEI *sei = unit->content;
434 if (unit->type != H264_NAL_SEI)
435 return AVERROR(EINVAL);
436 *list = &sei->message_list;
437 }
438 break;
439 case AV_CODEC_ID_H265:
440 {
441 H265RawSEI *sei = unit->content;
442 if (unit->type != HEVC_NAL_SEI_PREFIX &&
443 unit->type != HEVC_NAL_SEI_SUFFIX)
444 return AVERROR(EINVAL);
445 *list = &sei->message_list;
446 }
447 break;
448 case AV_CODEC_ID_H266:
449 {
450 H266RawSEI *sei = unit->content;
451 if (unit->type != VVC_PREFIX_SEI_NUT &&
452 unit->type != VVC_SUFFIX_SEI_NUT)
453 return AVERROR(EINVAL);
454 *list = &sei->message_list;
455 }
456 break;
457 default:
458 return AVERROR(EINVAL);
459 }
460
461 return 0;
462}
463
466 int prefix,
467 uint32_t payload_type,
468 void *payload_data,
469 void *payload_ref)
470{
472 CodedBitstreamUnit *unit;
475 int err;
476
477 desc = ff_cbs_sei_find_type(ctx, payload_type);
478 if (!desc)
479 return AVERROR(EINVAL);
480
481 // Find an existing SEI unit or make a new one to add to.
482 err = cbs_sei_get_unit(ctx, au, prefix, &unit);
483 if (err < 0)
484 return err;
485
486 // Find the message list inside the codec-dependent unit.
487 err = cbs_sei_get_message_list(ctx, unit, &list);
488 if (err < 0)
489 return err;
490
491 // Add a new message to the message list.
493 if (err < 0)
494 return err;
495
496 if (payload_ref) {
497 /* The following just increments payload_ref's refcount,
498 * so that payload_ref is now owned by us. */
499 payload_ref = av_refstruct_ref(payload_ref);
500 }
501
502 message = &list->messages[list->nb_messages - 1];
503
504 message->payload_type = payload_type;
505 message->payload = payload_data;
506 message->payload_ref = payload_ref;
507
508 return 0;
509}
510
513 uint32_t payload_type,
514 SEIRawMessage **iter)
515{
516 int err, i, j, found;
517
518 found = 0;
519 for (i = 0; i < au->nb_units; i++) {
520 CodedBitstreamUnit *unit = &au->units[i];
522
523 err = cbs_sei_get_message_list(ctx, unit, &list);
524 if (err < 0)
525 continue;
526
527 for (j = 0; j < list->nb_messages; j++) {
528 SEIRawMessage *message = &list->messages[j];
529
530 if (message->payload_type == payload_type) {
531 if (!*iter || found) {
532 *iter = message;
533 return 0;
534 }
535 if (message == *iter)
536 found = 1;
537 }
538 }
539 }
540
541 return AVERROR(ENOENT);
542}
543
545 int position)
546{
548
549 av_assert0(0 <= position && position < list->nb_messages);
550
551 message = &list->messages[position];
552 av_refstruct_unref(&message->payload_ref);
553 av_refstruct_unref(&message->extension_data);
554
555 --list->nb_messages;
556
557 if (list->nb_messages > 0) {
558 memmove(list->messages + position,
559 list->messages + position + 1,
560 (list->nb_messages - position) * sizeof(*list->messages));
561 }
562}
563
566 uint32_t payload_type)
567{
568 int err, i, j;
569
570 for (i = 0; i < au->nb_units; i++) {
571 CodedBitstreamUnit *unit = &au->units[i];
573
574 err = cbs_sei_get_message_list(ctx, unit, &list);
575 if (err < 0)
576 continue;
577
578 for (j = list->nb_messages - 1; j >= 0; j--) {
579 if (list->messages[j].payload_type == payload_type)
581 }
582 }
583}
584
585// Macro for the read/write pair.
586#define SEI_MESSAGE_RW(codec, name) \
587 .read = cbs_ ## codec ## _read_ ## name ## _internal, \
588 .write = cbs_ ## codec ## _write_ ## name ## _internal
589
591 {
593 1, 1,
594 sizeof(SEIRawFillerPayload),
595 SEI_MESSAGE_RW(sei, filler_payload),
596 },
597 {
599 1, 1,
601 SEI_MESSAGE_RW(sei, user_data_registered),
602 },
603 {
605 1, 1,
607 SEI_MESSAGE_RW(sei, user_data_unregistered),
608 },
609 {
611 1, 0,
613 SEI_MESSAGE_RW(sei, frame_packing_arrangement),
614 },
615 {
617 0, 1,
619 SEI_MESSAGE_RW(sei, decoded_picture_hash),
620 },
621 {
623 1, 0,
625 SEI_MESSAGE_RW(sei, mastering_display_colour_volume),
626 },
627 {
629 1, 0,
631 SEI_MESSAGE_RW(sei, content_light_level_info),
632 },
633 {
635 1, 0,
637 SEI_MESSAGE_RW(sei, alternative_transfer_characteristics),
638 },
639 {
641 1, 0,
643 SEI_MESSAGE_RW(sei, ambient_viewing_environment),
644 },
646};
647
649 {
651 1, 0,
653 SEI_MESSAGE_RW(sei, film_grain_characteristics),
654 },
655 {
657 1, 0,
659 SEI_MESSAGE_RW(sei, display_orientation)
660 },
661 {
663 1, 0,
665 SEI_MESSAGE_RW(sei, frame_field_information)
666 },
668};
669
671 int payload_type)
672{
674 int i;
675
676 switch (ctx->codec->codec_id) {
677#if CBS_H264
678 case AV_CODEC_ID_H264:
680 break;
681#endif
682#if CBS_H265
683 case AV_CODEC_ID_H265:
685 break;
686#endif
687 case AV_CODEC_ID_H266:
689 break;
690 }
691
692 for (i = 0; codec_list && codec_list[i].type >= 0; i++) {
693 if (codec_list[i].type == payload_type)
694 return &codec_list[i];
695 }
696
697 for (i = 0; cbs_sei_common_types[i].type >= 0; i++) {
698 if (cbs_sei_common_types[i].type == payload_type)
699 return &cbs_sei_common_types[i];
700 }
701
702 return NULL;
703}
static AVFormatContext * ctx
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
const SEIMessageTypeDescriptor ff_cbs_sei_h264_types[]
Definition cbs_h264.c:744
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
static int FUNC sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
const SEIMessageTypeDescriptor ff_cbs_sei_h265_types[]
Definition cbs_h265.c:764
static void cbs_sei_delete_message(SEIRawMessageList *list, int position)
Definition cbs_sei.c:544
#define SEI_MESSAGE_RW(codec, name)
Definition cbs_sei.c:586
void ff_cbs_sei_free_message_list(SEIRawMessageList *list)
Free all SEI messages in a message list.
Definition cbs_sei.c:288
int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, const SEIMessageTypeDescriptor *desc)
Allocate a new payload for the given SEI message.
Definition cbs_sei.c:240
void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type)
Delete all messages with the given payload type from an access unit.
Definition cbs_sei.c:564
static const SEIMessageTypeDescriptor cbs_sei_h274_types[]
Definition cbs_sei.c:648
static int cbs_sei_get_message_list(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, SEIRawMessageList **list)
Definition cbs_sei.c:426
int ff_cbs_sei_list_add(SEIRawMessageList *list)
Allocate a new empty SEI message in a message list.
Definition cbs_sei.c:266
static void cbs_free_user_data_registered(AVRefStructOpaque unused, void *obj)
Definition cbs_sei.c:228
static void cbs_free_user_data_unregistered(AVRefStructOpaque unused, void *obj)
Definition cbs_sei.c:234
int ff_cbs_sei_add_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, uint32_t payload_type, void *payload_data, void *payload_ref)
Add an SEI message to an access unit.
Definition cbs_sei.c:464
static int cbs_sei_get_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int prefix, CodedBitstreamUnit **sei_unit)
Definition cbs_sei.c:298
const SEIMessageTypeDescriptor * ff_cbs_sei_find_type(CodedBitstreamContext *ctx, int payload_type)
Find the type descriptor for the given payload type.
Definition cbs_sei.c:670
static const SEIMessageTypeDescriptor cbs_sei_common_types[]
Definition cbs_sei.c:590
int ff_cbs_sei_find_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, SEIRawMessage **iter)
Iterate over messages with the given payload type in an access unit.
Definition cbs_sei.c:511
#define SEI_MESSAGE_TYPE_END
Definition cbs_sei.h:202
#define AV_CODEC_ID_H265
Definition codec_id.h:224
#define AV_CODEC_ID_H266
Definition codec_id.h:248
#define NULL
Definition coverity.c:32
static ListView * list
Definition ffplay.c:377
@ AV_CODEC_ID_H264
Definition codec_id.h:77
#define AVERROR(e)
Definition error.h:45
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Definition mem.c:318
@ H264_NAL_SEI
Definition h264.h:40
@ H264_NAL_IDR_SLICE
Definition h264.h:39
enum MPFType type
Definition jpegmpfenc.c:55
@ HEVC_NAL_SEI_SUFFIX
Definition hevc.h:69
@ HEVC_NAL_RSV_VCL31
Definition hevc.h:60
@ HEVC_NAL_SEI_PREFIX
Definition hevc.h:68
@ VVC_PREFIX_SEI_NUT
Definition vvc.h:52
@ VVC_RSV_IRAP_11
Definition vvc.h:40
@ VVC_SUFFIX_SEI_NUT
Definition vvc.h:53
const char * desc
Definition libsvtav1.c:83
Memory handling functions.
static const char * obj
Definition mscl.c:57
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition refstruct.c:121
void * av_refstruct_ref(void *obj)
Create a new reference to an object managed via this API, i.e.
Definition refstruct.c:141
static void * av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(AVRefStructOpaque opaque, void *obj))
A wrapper around av_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
Definition refstruct.h:94
@ SEI_TYPE_DECODED_PICTURE_HASH
Definition sei.h:91
@ SEI_TYPE_FILLER_PAYLOAD
Definition sei.h:33
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
Definition sei.h:34
@ SEI_TYPE_DISPLAY_ORIENTATION
Definition sei.h:77
@ SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS
Definition sei.h:106
@ SEI_TYPE_FRAME_PACKING_ARRANGEMENT
Definition sei.h:75
@ SEI_TYPE_FRAME_FIELD_INFO
Definition sei.h:126
@ SEI_TYPE_USER_DATA_UNREGISTERED
Definition sei.h:35
@ SEI_TYPE_FILM_GRAIN_CHARACTERISTICS
Definition sei.h:49
@ SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO
Definition sei.h:103
@ SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT
Definition sei.h:107
@ SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
Definition sei.h:96
Context structure for coded bitstream operations.
Definition cbs.h:226
Coded bitstream fragment structure, combining one or more units.
Definition cbs.h:129
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
Definition cbs.h:175
int nb_units
Number of units in this fragment.
Definition cbs.h:160
Coded bitstream unit structure.
Definition cbs.h:77
void * content
Pointer to the decomposed form of this unit.
Definition cbs.h:114
CodedBitstreamUnitType type
Codec-specific type of this unit.
Definition cbs.h:81
uint8_t * data_ref
RefStruct reference.
Definition cbs_sei.h:37
uint8_t * data_ref
RefStruct reference.
Definition cbs_sei.h:44
#define av_free(p)
const FFCodec * codec_list[]
RefStruct is an API for creating reference-counted objects with minimal overhead.
Definition refstruct.h:58
char prefix[8]