#ifndef AVCODEC_BYTESTREAM_H
#define AVCODEC_BYTESTREAM_H
#include <stdint.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
GetByteContext;
PutByteContext;
#define DEF(type, name, bytes, read, write) …
DEF(…)
DEF(…)
DEF(…)
DEF(…)
DEF(…)
DEF(…)
DEF(…)
DEF(…)
DEF(…)
#if AV_HAVE_BIGENDIAN
#define bytestream2_get_ne16 …
#define bytestream2_get_ne24 …
#define bytestream2_get_ne32 …
#define bytestream2_get_ne64 …
#define bytestream2_get_ne16u …
#define bytestream2_get_ne24u …
#define bytestream2_get_ne32u …
#define bytestream2_get_ne64u …
#define bytestream2_put_ne16 …
#define bytestream2_put_ne24 …
#define bytestream2_put_ne32 …
#define bytestream2_put_ne64 …
#define bytestream2_peek_ne16 …
#define bytestream2_peek_ne24 …
#define bytestream2_peek_ne32 …
#define bytestream2_peek_ne64 …
#else
#define bytestream2_get_ne16 …
#define bytestream2_get_ne24 …
#define bytestream2_get_ne32 …
#define bytestream2_get_ne64 …
#define bytestream2_get_ne16u …
#define bytestream2_get_ne24u …
#define bytestream2_get_ne32u …
#define bytestream2_get_ne64u …
#define bytestream2_put_ne16 …
#define bytestream2_put_ne24 …
#define bytestream2_put_ne32 …
#define bytestream2_put_ne64 …
#define bytestream2_peek_ne16 …
#define bytestream2_peek_ne24 …
#define bytestream2_peek_ne32 …
#define bytestream2_peek_ne64 …
#endif
static av_always_inline void bytestream2_init(GetByteContext *g,
const uint8_t *buf,
int buf_size)
{ … }
static av_always_inline void bytestream2_init_writer(PutByteContext *p,
uint8_t *buf,
int buf_size)
{ … }
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
{ … }
static av_always_inline int bytestream2_get_bytes_left_p(PutByteContext *p)
{ … }
static av_always_inline void bytestream2_skip(GetByteContext *g,
unsigned int size)
{ … }
static av_always_inline void bytestream2_skipu(GetByteContext *g,
unsigned int size)
{ … }
static av_always_inline void bytestream2_skip_p(PutByteContext *p,
unsigned int size)
{ … }
static av_always_inline int bytestream2_tell(GetByteContext *g)
{ … }
static av_always_inline int bytestream2_tell_p(PutByteContext *p)
{ … }
static av_always_inline int bytestream2_size(GetByteContext *g)
{ … }
static av_always_inline int bytestream2_size_p(PutByteContext *p)
{ … }
static av_always_inline int bytestream2_seek(GetByteContext *g,
int offset,
int whence)
{ … }
static av_always_inline int bytestream2_seek_p(PutByteContext *p,
int offset,
int whence)
{ … }
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g,
uint8_t *dst,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g,
uint8_t *dst,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
const uint8_t *src,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p,
const uint8_t *src,
unsigned int size)
{ … }
static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
const uint8_t c,
unsigned int size)
{ … }
static av_always_inline void bytestream2_set_bufferu(PutByteContext *p,
const uint8_t c,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
{ … }
static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p,
GetByteContext *g,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p,
GetByteContext *g,
unsigned int size)
{ … }
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b,
uint8_t *dst,
unsigned int size)
{ … }
static av_always_inline void bytestream_put_buffer(uint8_t **b,
const uint8_t *src,
unsigned int size)
{ … }
#endif