Go to the documentation of this file.
21 #ifndef AVCODEC_AV1_PARSE_H
22 #define AVCODEC_AV1_PARSE_H
35 #define MAX_OBU_HEADER_SIZE (2 + 8)
95 for (
i = 0;
i < 8;
i++) {
97 ret |= (int64_t)(
byte & 0x7f) << (
i * 7);
105 int64_t *obu_size,
int *start_pos,
int *
type,
106 int *temporal_id,
int *spatial_id)
109 int ret, extension_flag, has_size_flag;
124 if (extension_flag) {
129 *temporal_id = *spatial_id = 0;
132 *obu_size = has_size_flag ?
leb128(&gb)
133 : buf_size - 1 - extension_flag;
140 size = *obu_size + *start_pos;
156 if (
size > INT_MAX / 8)
162 while (
size > 0 && buf[
size - 1] == 0)
170 if (
size > INT_MAX / 8)
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int64_t leb128(GetBitContext *gb)
static int get_bits_count(const GetBitContext *s)
int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx)
Extract an OBU from a raw bitstream.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
An input packet split into OBUs.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int parse_obu_header(const uint8_t *buf, int buf_size, int64_t *obu_size, int *start_pos, int *type, int *temporal_id, int *spatial_id)
Rational number (pair of numerator and denominator).
static unsigned int get_bits1(GetBitContext *s)
AVRational ff_av1_framerate(int64_t ticks_per_frame, int64_t units_per_tick, int64_t time_scale)
static int get_obu_bit_length(const uint8_t *buf, int size, int type)
int raw_size
Size of entire OBU, including header.
static void skip_bits1(GetBitContext *s)
int size_bits
Size, in bits, of just the data, excluding the trailing_one_bit and any trailing padding.
unsigned obus_allocated_size
#define i(width, name, range_min, range_max)
int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *logctx)
Split an input packet into OBUs.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void ff_av1_packet_uninit(AV1Packet *pkt)
Free all the allocated memory in the packet.
#define MAX_OBU_HEADER_SIZE