46 #define C93_HAS_PALETTE 0x01
47 #define C93_FIRST_FRAME 0x02
73 int from_x = offset %
WIDTH;
74 int from_y = offset /
WIDTH;
75 int overflow = from_x + width -
WIDTH;
82 if (from_y + height >
HEIGHT) {
90 for (i = 0; i <
height; i++) {
91 memcpy(&to[i*stride+width], &from[(from_y+i)*stride], overflow);
95 for (i = 0; i <
height; i++) {
96 memcpy(&to[i*stride], &from[(from_y+i)*stride+from_x], width);
106 for (y = 0; y <
height; y++) {
108 cols[0] = grps[3 * (y >> 1)];
109 for (x = 0; x <
width; x++) {
111 cols[1]= grps[(x >> 1) + 1];
112 out[x + y*
stride] = cols[col & ((1 << bpp) - 1)];
122 int buf_size = avpkt->
size;
138 b = bytestream2_get_byte(&gb);
147 for (y = 0; y <
HEIGHT; y += 8) {
149 for (x = 0; x <
WIDTH; x += 8) {
156 bt = bytestream2_get_byte(&gb);
158 block_type= bt & 0x0F;
159 switch (block_type) {
161 offset = bytestream2_get_le16(&gb);
162 if ((ret =
copy_block(avctx, out, copy_from, offset, 8, stride)) < 0)
167 copy_from = newpic->
data[0];
169 for (j = 0; j < 8; j += 4) {
170 for (i = 0; i < 8; i += 4) {
171 int offset = bytestream2_get_le16(&gb);
172 int from_x = offset %
WIDTH;
173 int from_y = offset /
WIDTH;
175 (
FFABS(from_x - x-i) < 4 ||
FFABS(from_x - x-i) > WIDTH-4)) {
179 if ((ret =
copy_block(avctx, &out[j*stride+i],
180 copy_from, offset, 4, stride)) < 0)
188 for (i = 0; i < 8; i++) {
190 NULL, bytestream2_get_byte(&gb));
198 for (j = 0; j < 8; j += 4) {
199 for (i = 0; i < 8; i += 4) {
203 1, cols, NULL, bytestream2_get_le16(&gb));
207 2, cols, NULL, bytestream2_get_le32(&gb));
211 1, cols, grps, bytestream2_get_le16(&gb));
221 for (j = 0; j < 8; j++)
237 for (i = 0; i < 256; i++) {
238 palette[i] = 0xFF
U << 24 | bytestream2_get_be24(&gb);
243 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);