55 int outcnt = 0, maxcnt;
88 for (i = 0; i < 8; i++)
91 while (outcnt < maxcnt && buf_end - 2 >= buf) {
95 if (!(code & 0x8000)) {
101 if ((code & 0x6000) == 0x6000) {
103 int oidx = (code >> 10) & 7;
106 count = (code & 0x3FF) + 3;
108 if (offsets[oidx] < 0) {
109 if (buf_end - 3 < buf)
115 start = (outcnt + offsets[oidx]) % maxcnt;
117 if (maxcnt - start < count || maxcnt - outcnt < count)
122 "Frame reference does not exist\n");
126 memcpy(out + 2 * outcnt, prev + 2 * start, 2 * count);
129 int offset = (code & 0x1FFF) + 1;
131 if (!(code & 0x6000)) {
133 }
else if ((code & 0x6000) == 0x2000) {
136 if (buf_end - 1 < buf)
141 if (outcnt < offset || maxcnt - outcnt < count)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
static av_cold int init(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int decode_end(AVCodecContext *avctx)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
Overlapping memcpy() implementation.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char * name
Name of the codec implementation.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_RL24
static const uint8_t offset[127][2]
int width
picture width / height.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void decode_flush(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
uint16_t * last_frame_buffer
common internal api header.
common internal and external API header
#define AV_PIX_FMT_RGB555
static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
#define FFSWAP(type, a, b)
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.