32 int start_pos,
type, temporal_id, spatial_id;
36 &
type, &temporal_id, &spatial_id);
44 obu->
data = buf + start_pos;
50 "obu_type: %d, temporal_id: %d, spatial_id: %d, payload size: %d\n",
67 if (
pkt->obus_allocated <
pkt->nb_obus + 1) {
68 int new_size =
pkt->obus_allocated + 1;
71 if (new_size >= INT_MAX /
sizeof(*
tmp))
78 memset(
pkt->obus +
pkt->obus_allocated, 0,
sizeof(*
pkt->obus));
79 pkt->obus_allocated = new_size;
81 obu = &
pkt->obus[
pkt->nb_obus];
107 pkt->obus_allocated =
pkt->obus_allocated_size = 0;
115 if (ticks_per_frame && units_per_tick && time_scale &&
116 ticks_per_frame < INT64_MAX / units_per_tick &&
118 time_scale, INT_MAX))
void ff_av1_packet_uninit(AV1Packet *pkt)
Free all the allocated memory in the packet.
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)
int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx)
Extract an OBU from a raw bitstream.
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)
static int get_obu_bit_length(const uint8_t *buf, int size, int type)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
@ AV1_OBU_TEMPORAL_DELIMITER
Memory handling functions.
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.
Rational number (pair of numerator and denominator).