133 switch (frame_type) {
218 const uint8_t *buf,
int buf_size)
221 const uint8_t *ptr = buf, *
end = buf + buf_size;
int nb_units
Number of units in this fragment.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
int width
Dimensions of the decoded video intended for presentation.
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
CodedBitstreamUnitType type
Codec-specific type of this unit.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
static enum AVPixelFormat pix_fmts_10bit[2][2]
#define AV_PIX_FMT_YUV420P12
int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx)
Extract an OBU from a raw bitstream.
AVColorTransferCharacteristic
Color Transfer Characteristic.
static const CodedBitstreamUnitType decompose_unit_types[]
static enum AVPixelFormat pix_fmts_12bit[2][2]
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define AV_PIX_FMT_GRAY10
CodedBitstreamFragment temporal_unit
#define AV_PIX_FMT_GRAY12
uint8_t matrix_coefficients
enum AVPictureStructure picture_structure
Indicate whether a picture is coded as a frame, top field or bottom field.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
AVColorSpace
YUV colorspace type.
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
static av_cold int end(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
#define AV_PIX_FMT_YUV422P12
AVColorPrimaries
Chromaticity coordinates of the source primaries.
static int av1_parser_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
AVCodecParser ff_av1_parser
static enum AVPixelFormat pix_fmts_8bit[2][2]
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)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int av1_parser_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **out_data, int *out_size, const uint8_t *data, int size)
#define AV_PIX_FMT_YUV444P10
static av_cold int av1_parser_init(AVCodecParserContext *ctx)
static void av1_parser_close(AVCodecParserContext *ctx)
static char * split(char *message, char delim)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
void * log_ctx
Logging context to be passed to all av_log() calls associated with this context.
int width
picture width / height.
AV1ReferenceFrameState * ref
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
#define FF_ARRAY_ELEMS(a)
the normal 2^n-1 "JPEG" YUV ranges
int nb_decompose_unit_types
Length of the decompose_unit_types array.
Coded bitstream fragment structure, combining one or more units.
main external API structure.
#define AV_PIX_FMT_YUV420P10
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.
enum AVColorSpace colorspace
YUV colorspace type.
Rational number (pair of numerator and denominator).
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
CodedBitstreamContext * cbc
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
AV1RawSequenceHeader * sequence_header
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P12
the normal 219*2^(n-8) "MPEG" YUV ranges
void * priv_data
Internal codec-specific data.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
static int ref[MAX_W *MAX_W]
CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
int format
The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat...
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
AV1RawFrameHeader frame_header
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.
AVPixelFormat
Pixel format.
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
uint8_t transfer_characteristics