21#ifndef AVCODEC_AV1_PARSE_H
22#define AVCODEC_AV1_PARSE_H
36#define MAX_OBU_HEADER_SIZE (2 + 8)
94 int *temporal_id,
int *spatial_id)
97 int ret, extension_flag, has_size_flag;
112 if (extension_flag) {
117 *temporal_id = *spatial_id = 0;
121 : buf_size - 1 - extension_flag;
128 size = *obu_size + *start_pos;
144 if (
size > INT_MAX / 8)
150 while (
size > 0 && buf[
size - 1] == 0)
158 if (
size > INT_MAX / 8)
void ff_av1_packet_uninit(AV1Packet *pkt)
Free all the allocated memory in the packet.
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)
int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *logctx)
Split an input packet into OBUs.
AVRational ff_av1_framerate(int64_t ticks_per_frame, int64_t units_per_tick, int64_t time_scale)
#define MAX_OBU_HEADER_SIZE
int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx)
Extract an OBU from a raw bitstream.
static int get_obu_bit_length(const uint8_t *buf, int size, int type)
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int get_bits_count(const GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
leb128 handling implementations
static int64_t get_leb128(GetBitContext *gb)
Read a unsigned integer coded as a variable number of up to eight little-endian bytes,...
Utility Preprocessor macros.
int size_bits
Size, in bits, of just the data, excluding the trailing_one_bit and any trailing padding.
int raw_size
Size of entire OBU, including header.
An input packet split into OBUs.
unsigned obus_allocated_size
Rational number (pair of numerator and denominator).