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);
100 int height,
int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
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)];
118 const uint8_t *buf = avpkt->
data;
119 int buf_size = avpkt->
size;
125 int stride, i, x, y, bt = 0;
149 const uint8_t *palbuf = buf + buf_size - 768 - 1;
150 for (i = 0; i < 256; i++) {
151 palette[i] = bytestream_get_be24(&palbuf);
155 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);
158 for (y = 0; y <
HEIGHT; y += 8) {
160 for (x = 0; x <
WIDTH; x += 8) {
162 unsigned int offset, j;
163 uint8_t cols[4], grps[4];
169 block_type= bt & 0x0F;
170 switch (block_type) {
172 offset = bytestream_get_le16(&buf);
173 if (
copy_block(avctx, out, copy_from, offset, 8, stride))
178 copy_from = newpic->
data[0];
180 for (j = 0; j < 8; j += 4) {
181 for (i = 0; i < 8; i += 4) {
182 offset = bytestream_get_le16(&buf);
184 copy_from, offset, 4, stride))
192 for (i = 0; i < 8; i++) {
202 for (j = 0; j < 8; j += 4) {
203 for (i = 0; i < 8; i += 4) {
207 1, cols,
NULL, bytestream_get_le16(&buf));
211 2, cols,
NULL, bytestream_get_le32(&buf));
215 1, cols, grps, bytestream_get_le16(&buf));
225 for (j = 0; j < 8; j++)
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define FF_BUFFER_HINTS_VALID
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.
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)
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static int init(AVCodecParserContext *s)
static av_cold int decode_end(AVCodecContext *avctx)
#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.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
struct AVFrame AVFrame
Audio Video Frame.
static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size)
#define FF_BUFFER_HINTS_REUSABLE
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)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_BUFFER_HINTS_PRESERVE
#define FF_BUFFER_HINTS_READABLE
static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
8 bit with PIX_FMT_RGB32 palette
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