84 "on RGB streams encoded in BT.709 sRGB.\n");
93 "can only be set for 4:2:0 streams.\n");
103 UINT32_MAX > INT_MAX ? UINT32_MAX : INT_MAX);
142 for (i = 0; i < frag->
nb_units; i++) {
169 for (i = frag->
nb_units - 1; i >= 0; i--) {
209 for (i = 0; i < frag->
nb_units; i++) {
239 #define OFFSET(x) offsetof(AV1MetadataContext, x) 240 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM) 242 {
"td",
"Temporal Delimiter OBU",
246 { .i64 =
PASS }, .flags =
FLAGS, .unit =
"td" },
252 {
"color_primaries",
"Set color primaries (section 6.4.2)",
254 { .i64 = -1 }, -1, 255,
FLAGS },
255 {
"transfer_characteristics",
"Set transfer characteristics (section 6.4.2)",
257 { .i64 = -1 }, -1, 255,
FLAGS },
258 {
"matrix_coefficients",
"Set matrix coefficients (section 6.4.2)",
260 { .i64 = -1 }, -1, 255,
FLAGS },
262 {
"color_range",
"Set color range flag (section 6.4.2)",
264 { .i64 = -1 }, -1, 1,
FLAGS,
"cr" },
266 { .i64 = 0 }, .flags =
FLAGS, .unit =
"cr" },
268 { .i64 = 1 }, .flags =
FLAGS, .unit =
"cr" },
270 {
"chroma_sample_position",
"Set chroma sample position (section 6.4.2)",
272 { .i64 = -1 }, -1, 3,
FLAGS,
"csp" },
280 {
"tick_rate",
"Set display tick rate (num_units_in_display_tick / time_scale)",
282 { .dbl = 0.0 }, 0, UINT_MAX,
FLAGS },
283 {
"num_ticks_per_picture",
"Set display ticks per picture for CFR streams",
285 { .i64 = -1 }, -1, INT_MAX, FLAGS },
287 {
"delete_padding",
"Delete all Padding OBUs",
289 { .i64 = 0 }, 0, 1, FLAGS},
306 .
name =
"av1_metadata",
308 .priv_class = &av1_metadata_class,
int nb_units
Number of units in this fragment.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVCodecParameters * par_out
Parameters of the output stream.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
int ff_cbs_write_packet(CodedBitstreamContext *ctx, AVPacket *pkt, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to a packet.
static av_cold int init(AVCodecContext *avctx)
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
void ff_cbs_delete_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
CodedBitstreamUnitType type
Codec-specific type of this unit.
The bitstream filter state.
const char * av_default_item_name(void *ptr)
Return the context name.
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.
int chroma_sample_position
uint32_t num_units_in_display_tick
void * priv_data
Opaque filter-specific private data.
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
uint8_t matrix_coefficients
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.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
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.
#define i(width, name, range_min, range_max)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
CodedBitstreamContext * cbc
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
int ff_cbs_write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
Coded bitstream fragment structure, combining one or more units.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Describe the class of an AVClass context structure.
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...
Context structure for coded bitstream operations.
Rational number (pair of numerator and denominator).
uint8_t color_description_present_flag
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
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...
uint32_t num_ticks_per_picture_minus_1
AV1RawSequenceHeader sequence_header
uint8_t equal_picture_interval
IEC 61966-2-1 (sRGB or sYCC)
common internal and external API header
static enum AVCodecID codec_ids[]
CodedBitstreamFragment access_unit
uint8_t chroma_sample_position
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
int num_ticks_per_picture
int transfer_characteristics
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
uint8_t transfer_characteristics