staticinlineint 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)
{
GetBitContext gb; int ret, extension_flag, has_size_flag;
int64_t size;
ret = init_get_bits8(&gb, buf, FFMIN(buf_size, MAX_OBU_HEADER_SIZE)); if (ret < 0) return ret;
if (get_bits1(&gb) != 0) // obu_forbidden_bit return AVERROR_INVALIDDATA;
if (get_bits_left(&gb) < 0) return AVERROR_INVALIDDATA;
*start_pos = get_bits_count(&gb) / 8;
size = *obu_size + *start_pos;
if (size > buf_size) return AVERROR_INVALIDDATA;
return size;
}
staticinlineint get_obu_bit_length(const uint8_t *buf, int size, int type)
{ int v;
/* There are no trailing bits on these */ if (type == AV1_OBU_TILE_GROUP ||
type == AV1_OBU_TILE_LIST ||
type == AV1_OBU_FRAME) { if (size > INT_MAX / 8) return AVERROR(ERANGE); else return size * 8;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.