53 for (i = 0; i < 256; i++)
54 ((uint32_t*)s->
frame.
data[1])[i] = bytestream_get_le32(&buf);
74 static inline int op(uint8_t **dst,
const uint8_t *dst_end,
75 const uint8_t **buf,
const uint8_t *buf_end,
77 int *x,
int width,
int linesize)
79 int remaining = width - *x;
81 int striplen =
FFMIN(count, remaining);
83 striplen =
FFMIN(striplen, buf_end - *buf);
86 memcpy(*dst, *buf, striplen);
88 }
else if (pixel >= 0)
89 memset(*dst, pixel, striplen);
91 remaining -= striplen;
94 *dst += linesize -
width;
98 if (*dst >= dst_end)
goto exhausted;
100 if (*dst <= dst_end)
goto exhausted;
103 *x = width - remaining;
107 *x = width - remaining;
112 void *
data,
int *data_size,
116 const uint8_t *buf = avpkt->
data;
117 const int buf_size = avpkt->
size;
118 const uint8_t *buf_end = buf + buf_size;
119 uint8_t *dst, *dst_end;
129 if (buf[0] != 0x42) {
142 #define OP(buf, pixel, count) \
143 op(&dst, dst_end, (buf), buf_end, (pixel), (count), &s->x, avctx->width, s->frame.linesize[0])
145 int type = bytestream_get_byte(&buf);
149 if (
OP(type ?
NULL : &buf, -1, count))
break;
152 count = bytestream_get_byte(&buf);
153 pixel = bytestream_get_byte(&buf);
154 if (
OP(
NULL, pixel, count))
break;
157 type = bytestream_get_le16(&buf);
158 count = type & 0x3FFF;
169 pixel = type == 3 ? bytestream_get_byte(&buf) : -1;
170 if (type == 1) count += 0x4000;
171 if (
OP(type == 2 ? &buf :
NULL, pixel, count))
break;
173 }
while (buf + 1 < buf_end);
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
struct AVFrame AVFrame
Audio Video Frame.
static av_cold int decode_init(AVCodecContext *avctx)
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int x
x coordinate position
8 bit with PIX_FMT_RGB32 palette
static av_cold int decode_end(AVCodecContext *avctx)
struct AnmContext AnmContext
static int op(uint8_t **dst, const uint8_t *dst_end, const uint8_t **buf, const uint8_t *buf_end, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
#define OP(buf, pixel, count)