38#define LZF_LITERAL_MAX (1 << 5)
39#define LZF_LONG_BACKREF 7 + 2
42static inline int lzf_realloc(uint8_t **buf,
size_t new_size,
unsigned *allocated_size)
62 uint8_t
s = bytestream2_get_byte(gb);
81 int off = ((
s & 0x1f) << 8) + 1;
84 l += bytestream2_get_byte(gb);
86 off += bytestream2_get_byte(gb);
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
Misc types and constants that do not belong anywhere else.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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.
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
Overlapping memcpy() implementation.
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned *allocated_size)
Decompress LZF data into *buf, reallocating it as needed.
static int lzf_realloc(uint8_t **buf, size_t new_size, unsigned *allocated_size)
Memory handling functions.