Go to the documentation of this file.
54 if (
ctx->color_primaries >= 0 ||
55 ctx->transfer_characteristics >= 0 ||
56 ctx->matrix_coefficients >= 0) {
59 if (
ctx->color_primaries >= 0)
61 if (
ctx->transfer_characteristics >= 0)
63 if (
ctx->matrix_coefficients >= 0)
67 if (
ctx->color_range >= 0) {
72 "on RGB streams encoded in BT.709 sRGB.\n");
78 if (
ctx->chroma_sample_position >= 0) {
81 "can only be set for 4:2:0 streams.\n");
87 if (
ctx->tick_rate.num &&
ctx->tick_rate.den) {
91 UINT32_MAX > INT_MAX ? UINT32_MAX : INT_MAX);
97 if (
ctx->num_ticks_per_picture > 0) {
100 ctx->num_ticks_per_picture - 1;
135 if (
ctx->delete_padding) {
147 .fragment_name =
"temporal unit",
163 #define OFFSET(x) offsetof(AV1MetadataContext, x)
164 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
169 {
"color_primaries",
"Set color primaries (section 6.4.2)",
171 { .i64 = -1 }, -1, 255,
FLAGS },
172 {
"transfer_characteristics",
"Set transfer characteristics (section 6.4.2)",
174 { .i64 = -1 }, -1, 255,
FLAGS },
175 {
"matrix_coefficients",
"Set matrix coefficients (section 6.4.2)",
177 { .i64 = -1 }, -1, 255,
FLAGS },
179 {
"color_range",
"Set color range flag (section 6.4.2)",
181 { .i64 = -1 }, -1, 1,
FLAGS,
"cr" },
183 { .i64 = 0 }, .flags =
FLAGS, .unit =
"cr" },
185 { .i64 = 1 }, .flags =
FLAGS, .unit =
"cr" },
187 {
"chroma_sample_position",
"Set chroma sample position (section 6.4.2)",
189 { .i64 = -1 }, -1, 3,
FLAGS,
"csp" },
197 {
"tick_rate",
"Set display tick rate (num_units_in_display_tick / time_scale)",
199 { .dbl = 0.0 }, 0, UINT_MAX,
FLAGS },
200 {
"num_ticks_per_picture",
"Set display ticks per picture for CFR streams",
202 { .i64 = -1 }, -1, INT_MAX,
FLAGS },
204 {
"delete_padding",
"Delete all Padding OBUs",
206 { .i64 = 0 }, 0, 1,
FLAGS},
223 .
name =
"av1_metadata",
uint32_t num_units_in_display_tick
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
Initialise generic CBS BSF setup.
void * content
Pointer to the decomposed form of this unit.
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
CodedBitstreamUnitType type
Codec-specific type of this unit.
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
@ AV1_OBU_TEMPORAL_DELIMITER
The bitstream filter state.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Coded bitstream fragment structure, combining one or more units.
uint8_t transfer_characteristics
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, AVBufferRef *content_buf)
Insert a new unit into a fragment with the given content.
Rational number (pair of numerator and denominator).
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
const char * av_default_item_name(void *ptr)
Return the context name.
uint8_t chroma_sample_position
int transfer_characteristics
AVCodecID
Identify the syntax and semantics of the bitstream.
int chroma_sample_position
uint32_t num_ticks_per_picture_minus_1
AV1RawSequenceHeader sequence_header
void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
@ AV1_OBU_SEQUENCE_HEADER
uint8_t color_description_present_flag
uint8_t equal_picture_interval
void * priv_data
Opaque filter-specific private data.
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define BSF_ELEMENT_OPTIONS_PIR(name, help, field, opt_flags)
uint8_t matrix_coefficients
static enum AVCodecID codec_ids[]
This structure stores compressed data.
static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB]
int num_ticks_per_picture
int nb_units
Number of units in this fragment.
void ff_cbs_delete_unit(CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.