55 if (
ctx->color_primaries >= 0 ||
56 ctx->transfer_characteristics >= 0 ||
57 ctx->matrix_coefficients >= 0) {
60 if (
ctx->color_primaries >= 0)
62 if (
ctx->transfer_characteristics >= 0)
64 if (
ctx->matrix_coefficients >= 0)
68 if (
ctx->color_range >= 0) {
73 "on RGB streams encoded in BT.709 sRGB.\n");
79 if (
ctx->chroma_sample_position >= 0) {
82 "can only be set for 4:2:0 streams.\n");
88 if (
ctx->tick_rate.num &&
ctx->tick_rate.den) {
92 UINT32_MAX > INT_MAX ? UINT32_MAX : INT_MAX);
98 if (
ctx->num_ticks_per_picture > 0) {
101 ctx->num_ticks_per_picture - 1;
126 ff_cbs_delete_unit(frag, 0);
136 if (
ctx->delete_padding) {
139 ff_cbs_delete_unit(frag,
i);
148 .fragment_name =
"temporal unit",
164#define OFFSET(x) offsetof(AV1MetadataContext, x)
165#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
170 {
"color_primaries",
"Set color primaries (section 6.4.2)",
172 { .i64 = -1 }, -1, 255,
FLAGS },
173 {
"transfer_characteristics",
"Set transfer characteristics (section 6.4.2)",
175 { .i64 = -1 }, -1, 255,
FLAGS },
176 {
"matrix_coefficients",
"Set matrix coefficients (section 6.4.2)",
178 { .i64 = -1 }, -1, 255,
FLAGS },
180 {
"color_range",
"Set color range flag (section 6.4.2)",
182 { .i64 = -1 }, -1, 1,
FLAGS, .unit =
"cr" },
184 { .i64 = 0 }, .flags =
FLAGS, .unit =
"cr" },
186 { .i64 = 1 }, .flags =
FLAGS, .unit =
"cr" },
188 {
"chroma_sample_position",
"Set chroma sample position (section 6.4.2)",
190 { .i64 = -1 }, -1, 3,
FLAGS, .unit =
"csp" },
198 {
"tick_rate",
"Set display tick rate (time_scale / num_units_in_display_tick)",
200 { .dbl = 0.0 }, 0, UINT_MAX,
FLAGS },
201 {
"num_ticks_per_picture",
"Set display ticks per picture for CFR streams",
203 { .i64 = -1 }, -1, INT_MAX,
FLAGS },
205 {
"delete_padding",
"Delete all Padding OBUs",
207 { .i64 = 0 }, 0, 1,
FLAGS},
213 .class_name =
"av1_metadata_bsf",
224 .p.name =
"av1_metadata",
static av_cold void close(AVCodecParserContext *s)
const FFBitStreamFilter ff_av1_metadata_bsf
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
av_cold int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
Initialise generic CBS BSF setup.
#define BSF_ELEMENT_OPTIONS_PIR(name, help, field, opt_flags)
#define i(width, name, range_min, range_max)
common internal and external API header
static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB]
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define LIBAVUTIL_VERSION_INT
@ AV1_OBU_TEMPORAL_DELIMITER
@ AV1_OBU_SEQUENCE_HEADER
static const struct TransferCharacteristics transfer_characteristics[]
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
int transfer_characteristics
int num_ticks_per_picture
int chroma_sample_position
uint8_t matrix_coefficients
uint8_t chroma_sample_position
uint8_t color_description_present_flag
uint8_t transfer_characteristics
AV1RawSequenceHeader sequence_header
union AV1RawOBU::@016362317061177152367125047142162076164261250366 obu
uint32_t num_units_in_display_tick
uint32_t num_ticks_per_picture_minus_1
uint8_t equal_picture_interval
The bitstream filter state.
void * priv_data
Opaque filter-specific private data.
Describe the class of an AVClass context structure.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
Coded bitstream fragment structure, combining one or more units.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
int nb_units
Number of units in this fragment.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnitType type
Codec-specific type of this unit.
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static AVFormatContext * ctx