46 #define C93_HAS_PALETTE 0x01
47 #define C93_FIRST_FRAME 0x02
79 int from_x = offset %
WIDTH;
80 int from_y = offset /
WIDTH;
81 int overflow = from_x + width -
WIDTH;
88 if (from_y + height >
HEIGHT) {
96 for (i = 0; i <
height; i++) {
97 memcpy(&to[i*stride+width], &from[(from_y+i)*stride], overflow);
101 for (i = 0; i <
height; i++) {
102 memcpy(&to[i*stride], &from[(from_y+i)*stride+from_x], width);
112 for (y = 0; y <
height; y++) {
114 cols[0] = grps[3 * (y >> 1)];
115 for (x = 0; x <
width; x++) {
117 cols[1]= grps[(x >> 1) + 1];
118 out[x + y*
stride] = cols[col & ((1 << bpp) - 1)];
128 int buf_size = avpkt->
size;
134 int stride, ret, i, x, y,
b, bt = 0;
147 b = bytestream2_get_byte(&gb);
156 for (y = 0; y <
HEIGHT; y += 8) {
158 for (x = 0; x <
WIDTH; x += 8) {
165 bt = bytestream2_get_byte(&gb);
167 block_type= bt & 0x0F;
168 switch (block_type) {
170 offset = bytestream2_get_le16(&gb);
171 if ((ret =
copy_block(avctx, out, copy_from, offset, 8, stride)) < 0)
176 copy_from = newpic->
data[0];
178 for (j = 0; j < 8; j += 4) {
179 for (i = 0; i < 8; i += 4) {
180 int offset = bytestream2_get_le16(&gb);
181 int from_x = offset %
WIDTH;
182 int from_y = offset /
WIDTH;
184 (
FFABS(from_x - x-i) < 4 ||
FFABS(from_x - x-i) > WIDTH-4)) {
188 if ((ret =
copy_block(avctx, &out[j*stride+i],
189 copy_from, offset, 4, stride)) < 0)
197 for (i = 0; i < 8; i++) {
199 NULL, bytestream2_get_byte(&gb));
207 for (j = 0; j < 8; j += 4) {
208 for (i = 0; i < 8; i += 4) {
212 1, cols,
NULL, bytestream2_get_le16(&gb));
216 2, cols,
NULL, bytestream2_get_le32(&gb));
220 1, cols, grps, bytestream2_get_le16(&gb));
230 for (j = 0; j < 8; j++)
246 for (i = 0; i < 256; i++) {
247 palette[i] = 0xFF
U << 24 | bytestream2_get_be24(&gb);
252 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
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_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)
static av_cold int decode_init(AVCodecContext *avctx)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
8 bits with AV_PIX_FMT_RGB32 palette
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int decode_end(AVCodecContext *avctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#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)
const char * name
Name of the codec implementation.
static const uint8_t offset[127][2]
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
enum AVPictureType pict_type
Picture type of the frame.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static int copy_from(IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
GLint GLenum GLboolean GLsizei stride
common internal api header.
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
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.