55 int outcnt = 0, maxcnt;
65 if (avpkt->
size < 2 + w*h / 513)
91 for (i = 0; i < 8; i++)
94 while (outcnt < maxcnt && buf_end - 2 >= buf) {
98 if (!(code & 0x8000)) {
104 if ((code & 0x6000) == 0x6000) {
106 int oidx = (code >> 10) & 7;
109 count = (code & 0x3FF) + 3;
111 if (offsets[oidx] < 0) {
112 if (buf_end - 3 < buf)
118 start = (outcnt + offsets[oidx]) % maxcnt;
120 if (maxcnt - start < count || maxcnt - outcnt < count)
125 "Frame reference does not exist\n");
129 memcpy(out + 2 * outcnt, prev + 2 * start, 2 * count);
132 int offset = (code & 0x1FFF) + 1;
134 if (!(code & 0x6000)) {
136 }
else if ((code & 0x6000) == 0x2000) {
139 if (buf_end - 1 < buf)
144 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
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
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
#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.