50 for (i = 0; i < 256; i++)
51 s->
palette[i] = bytestream2_get_le32u(&s->
gb);
75 int *x,
int width,
int linesize)
77 int remaining = width - *x;
79 int striplen =
FFMIN(count, remaining);
84 }
else if (pixel >= 0)
85 memset(*dst, pixel, striplen);
87 remaining -= striplen;
90 *dst += linesize -
width;
94 if (*dst >= dst_end)
goto exhausted;
96 if (*dst <= dst_end)
goto exhausted;
99 *x = width - remaining;
103 *x = width - remaining;
108 void *
data,
int *got_frame,
112 const int buf_size = avpkt->
size;
125 if (bytestream2_get_byte(&s->
gb) != 0x42) {
129 if (bytestream2_get_byte(&s->
gb)) {
138 #define OP(gb, pixel, count) \
139 op(&dst, dst_end, (gb), (pixel), (count), &s->x, avctx->width, s->frame.linesize[0])
141 int type = bytestream2_get_byte(&s->
gb);
145 if (
OP(type ?
NULL : &s->
gb, -1, count))
break;
148 count = bytestream2_get_byte(&s->
gb);
149 pixel = bytestream2_get_byte(&s->
gb);
150 if (
OP(
NULL, pixel, count))
break;
153 type = bytestream2_get_le16(&s->
gb);
154 count = type & 0x3FFF;
165 pixel = type == 3 ? bytestream2_get_byte(&s->
gb) : -1;
166 if (type == 1) count += 0x4000;
167 if (
OP(type == 2 ? &s->
gb :
NULL, pixel, count))
break;
This structure describes decoded (raw) audio or video data.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
#define OP(gb, pixel, count)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static int init(AVCodecParserContext *s)
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
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.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static av_cold int decode_init(AVCodecContext *avctx)
int palette[AVPALETTE_COUNT]
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
main external API structure.
static void close(AVCodecParserContext *s)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
int x
x coordinate position
#define AVERROR_PATCHWELCOME
static av_cold int decode_end(AVCodecContext *avctx)
struct AnmContext AnmContext
This structure stores compressed data.