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",
static enum AVCodecID codec_ids[]
static av_cold int init(AVCodecContext *avctx)
void ff_cbs_delete_unit(CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
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.
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
Initialise generic CBS BSF setup.
void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
#define BSF_ELEMENT_OPTIONS_PIR(name, help, field, opt_flags)
static av_always_inline void filter(int16_t *output, ptrdiff_t out_stride, const int16_t *low, ptrdiff_t low_stride, const int16_t *high, ptrdiff_t high_stride, int len, int clip)
common internal and external API header
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_TRC_NB]
static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB]
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 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)
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
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.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
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.