45 #define C93_HAS_PALETTE 0x01
46 #define C93_FIRST_FRAME 0x02
70 int from_x = offset %
WIDTH;
71 int from_y = offset /
WIDTH;
72 int overflow = from_x + width -
WIDTH;
79 if (from_y + height >
HEIGHT) {
87 for (i = 0; i <
height; i++) {
88 memcpy(&to[i*stride+width], &from[(from_y+i)*stride], overflow);
92 for (i = 0; i <
height; i++) {
93 memcpy(&to[i*stride], &from[(from_y+i)*stride+from_x], width);
103 for (y = 0; y <
height; y++) {
105 cols[0] = grps[3 * (y >> 1)];
106 for (x = 0; x <
width; x++) {
108 cols[1]= grps[(x >> 1) + 1];
109 out[x + y*
stride] = cols[col & ((1 << bpp) - 1)];
119 int buf_size = avpkt->
size;
126 int stride, i, x, y,
b, bt = 0;
141 b = bytestream2_get_byte(&gb);
150 for (y = 0; y <
HEIGHT; y += 8) {
152 for (x = 0; x <
WIDTH; x += 8) {
154 unsigned int offset, j;
159 bt = bytestream2_get_byte(&gb);
161 block_type= bt & 0x0F;
162 switch (block_type) {
164 offset = bytestream2_get_le16(&gb);
165 if (
copy_block(avctx, out, copy_from, offset, 8, stride))
170 copy_from = newpic->
data[0];
172 for (j = 0; j < 8; j += 4) {
173 for (i = 0; i < 8; i += 4) {
174 offset = bytestream2_get_le16(&gb);
176 copy_from, offset, 4, stride))
184 for (i = 0; i < 8; i++) {
186 NULL, bytestream2_get_byte(&gb));
194 for (j = 0; j < 8; j += 4) {
195 for (i = 0; i < 8; i += 4) {
199 1, cols,
NULL, bytestream2_get_le16(&gb));
203 2, cols,
NULL, bytestream2_get_le32(&gb));
207 1, cols, grps, bytestream2_get_le16(&gb));
217 for (j = 0; j < 8; j++)
232 uint32_t *palette = (uint32_t *) newpic->
data[1];
233 for (i = 0; i < 256; i++) {
234 palette[i] = bytestream2_get_be24(&gb);
239 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);
This structure describes decoded (raw) audio or video data.
int buffer_hints
codec suggestion on buffer type if != 0
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 void draw_n_color(uint8_t *out, int stride, int width, int height, int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static av_cold int decode_init(AVCodecContext *avctx)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static int init(AVCodecParserContext *s)
static av_cold int decode_end(AVCodecContext *avctx)
#define FF_BUFFER_HINTS_READABLE
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. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
int palette_has_changed
Tell user application that palette has changed from previous frame.
#define FF_BUFFER_HINTS_REUSABLE
static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
#define FF_BUFFER_HINTS_PRESERVE
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int copy_block(AVCodecContext *avctx, uint8_t *to, uint8_t *from, int offset, int height, int stride)
int key_frame
1 -> keyframe, 0-> not
#define FF_BUFFER_HINTS_VALID
This structure stores compressed data.