71 s->cbc->log_ctx = avctx;
74 s->parsed_extradata = 1;
98 for (
int i = 0;
i <
td->nb_units;
i++) {
113 if (!
frame->show_frame && !
frame->show_existing_frame)
116 ctx->width =
frame->frame_width_minus_1 + 1;
117 ctx->height =
frame->frame_height_minus_1 + 1;
121 switch (
frame->frame_type) {
152 if (!
color->subsampling_x && !
color->subsampling_y &&
172 s->cbc->log_ctx =
NULL;
209 const uint8_t *buf,
int buf_size)
212 const uint8_t *ptr = buf, *end = buf + buf_size;
static char * split(char *message, char delim)
int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx)
Extract an OBU from a raw bitstream.
static int av1_parser_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
AVCodecParser ff_av1_parser
static enum AVPixelFormat pix_fmts_rgb[3]
static enum AVPixelFormat pix_fmts_12bit[2][2]
static const CodedBitstreamUnitType decompose_unit_types[]
static enum AVPixelFormat pix_fmts_8bit[2][2]
static enum AVPixelFormat pix_fmts_10bit[2][2]
static void av1_parser_close(AVCodecParserContext *ctx)
static int av1_parser_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **out_data, int *out_size, const uint8_t *data, int size)
static av_cold int av1_parser_init(AVCodecParserContext *ctx)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecContext *avctx)
Read the extradata bitstream found in a codec context into a fragment, then split into units and deco...
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
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.
void ff_cbs_fragment_reset(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_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
@ AV_PICTURE_STRUCTURE_FRAME
@ AV_PICTURE_STRUCTURE_UNKNOWN
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_NONE
Undefined.
@ AV_PICTURE_TYPE_SP
Switching Predicted.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV1_OBU_TEMPORAL_DELIMITER
@ AV1_OBU_SEQUENCE_HEADER
common internal API header
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV420P10
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AV_PIX_FMT_GRAY10
AVColorPrimaries
Chromaticity coordinates of the source primaries.
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
#define AV_PIX_FMT_YUV444P10
AVColorSpace
YUV colorspace type.
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
#define FF_ARRAY_ELEMS(a)
CodedBitstreamFragment temporal_unit
CodedBitstreamContext * cbc
AV1RawFrameHeader frame_header
main external API structure.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
void * priv_data
Format private data.
Rational number (pair of numerator and denominator).
AV1RawSequenceHeader * sequence_header
Context structure for coded bitstream operations.
Coded bitstream fragment structure, combining one or more units.
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
CodedBitstreamUnitType type
Codec-specific type of this unit.