Go to the documentation of this file.
62 if (
ctx->color_primaries >= 0 ||
63 ctx->transfer_characteristics >= 0 ||
64 ctx->matrix_coefficients >= 0) {
67 if (
ctx->color_primaries >= 0)
69 if (
ctx->transfer_characteristics >= 0)
71 if (
ctx->matrix_coefficients >= 0)
75 if (
ctx->color_range >= 0) {
80 "on RGB streams encoded in BT.709 sRGB.\n");
86 if (
ctx->chroma_sample_position >= 0) {
89 "can only be set for 4:2:0 streams.\n");
95 if (
ctx->tick_rate.num &&
ctx->tick_rate.den) {
99 UINT32_MAX > INT_MAX ? UINT32_MAX : INT_MAX);
105 if (
ctx->num_ticks_per_picture > 0) {
108 ctx->num_ticks_per_picture - 1;
212 if (
ctx->delete_padding) {
283 #define OFFSET(x) offsetof(AV1MetadataContext, x)
284 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
286 {
"td",
"Temporal Delimiter OBU",
290 { .i64 =
PASS }, .flags =
FLAGS, .unit =
"td" },
296 {
"color_primaries",
"Set color primaries (section 6.4.2)",
298 { .i64 = -1 }, -1, 255,
FLAGS },
299 {
"transfer_characteristics",
"Set transfer characteristics (section 6.4.2)",
301 { .i64 = -1 }, -1, 255,
FLAGS },
302 {
"matrix_coefficients",
"Set matrix coefficients (section 6.4.2)",
304 { .i64 = -1 }, -1, 255,
FLAGS },
306 {
"color_range",
"Set color range flag (section 6.4.2)",
308 { .i64 = -1 }, -1, 1,
FLAGS,
"cr" },
310 { .i64 = 0 }, .flags =
FLAGS, .unit =
"cr" },
312 { .i64 = 1 }, .flags =
FLAGS, .unit =
"cr" },
314 {
"chroma_sample_position",
"Set chroma sample position (section 6.4.2)",
316 { .i64 = -1 }, -1, 3,
FLAGS,
"csp" },
324 {
"tick_rate",
"Set display tick rate (num_units_in_display_tick / time_scale)",
326 { .dbl = 0.0 }, 0, UINT_MAX,
FLAGS },
327 {
"num_ticks_per_picture",
"Set display ticks per picture for CFR streams",
329 { .i64 = -1 }, -1, INT_MAX,
FLAGS },
331 {
"delete_padding",
"Delete all Padding OBUs",
333 { .i64 = 0 }, 0, 1,
FLAGS},
350 .
name =
"av1_metadata",
uint32_t num_units_in_display_tick
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVCodecParameters * par_in
Parameters of the input stream.
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
static av_cold int init(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_cbs_read_extradata(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecParameters *par)
Read the extradata bitstream found in codec parameters into a fragment, then split into units and dec...
void * content
Pointer to the decomposed form of this unit.
Context structure for coded bitstream operations.
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
void ff_cbs_fragment_free(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
@ 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)
CodedBitstreamFragment access_unit
int ff_cbs_read(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const uint8_t *data, size_t size)
Read a bitstream from a memory region into a fragment, then split into units and decompose.
int ff_cbs_write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
AVCodecParameters * par_out
Parameters of the output stream.
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.
int ff_cbs_write_packet(CodedBitstreamContext *ctx, AVPacket *pkt, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to a packet.
size_t data_size
The number of bytes in the bitstream.
uint8_t transfer_characteristics
void ff_cbs_delete_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
CodedBitstreamContext * cbc
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
uint8_t * data
Pointer to the bitstream form of this fragment.
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
@ AV1_OBU_SEQUENCE_HEADER
uint8_t color_description_present_flag
#define i(width, name, range_min, range_max)
uint8_t equal_picture_interval
int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Write the content of the fragment to its own internal buffer.
void * priv_data
Opaque filter-specific private data.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
void ff_cbs_fragment_reset(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
int ff_cbs_read_packet(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
Read the data bitstream from a packet into a fragment, then split into units and decompose.
uint8_t matrix_coefficients
int ff_cbs_insert_unit_content(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, AVBufferRef *content_buf)
Insert a new unit into a fragment with the given content.
static enum AVCodecID codec_ids[]
This structure stores compressed data.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB]
int num_ticks_per_picture
int nb_units
Number of units in this fragment.