43 #define SCREEN_WIDE 640
44 #define SCREEN_HIGH 429
54 #define NEXT_BYTE(v) v = forward ? v + 1 : v - 1;
58 unsigned val, saved_val = 0;
60 const uint8_t *
src, *source_end = source + src_len;
64 int forward = (frame_off <= -
SCREEN_WIDE) || (frame_off >= 0);
65 int read_two_nibbles, flag;
78 src = source + src_len - 1;
93 if (!mode || (tmplen == 4)) {
94 if (src < source || src >= source_end)
100 read_two_nibbles = 0;
106 if (!read_two_nibbles) {
107 if (src < source || src >= source_end)
110 val |= *src <<
shift;
116 read_two_nibbles = 0;
118 mask = (1 <<
shift) - 1;
119 val = ((val >> 2) & ~mask) | (val &
mask);
121 if ((val & (0xC << shift))) {
132 saved_val = val >> (4 +
shift);
134 val &= (1 << (shift + 4)) - 1;
137 advance_mode = val & 1;
138 len = (val >> 1) - 1;
140 mode += 1 + advance_mode;
143 if (len <= 0 ||
FFABS(dst_end - dst) < len)
150 frame_end - dst < frame_off + len ||
151 frame_end - dst < len)
153 for (i = 0; i <
len; i++)
154 dst[i] = dst[frame_off + i];
160 frame_end - dst < frame_off + len ||
161 frame_end - dst < len)
163 for (i = len - 1; i >= 0; i--)
164 dst[i] = dst[frame_off + i];
169 if (source + src_len - src < len)
171 memcpy(dst, src, len);
175 if (src - source < len)
179 memcpy(dst, src, len);
183 val = forward ? dst[-1] : dst[1];
185 memset(dst, val, len);
189 memset(dst, val, len);
209 type = bytestream_get_byte(&c->
stream);
211 int blobs = bytestream_get_byte(&c->
stream);
212 if (pkt->
size < blobs * 65 + 2) {
219 int command_size = (type &
BMV_PRINT) ? 8 : 10;
224 c->
stream += command_size;
231 for (i = 0; i < 256; i++)
232 c->
pal[i] = 0xFFU << 24 | bytestream_get_be24(&c->
stream);
239 scr_off = (int16_t)bytestream_get_le16(&c->
stream);
257 outptr = frame->
data[0];
260 for (i = 0; i < avctx->
height; i++) {
261 memcpy(outptr, srcptr, avctx->
width);
262 srcptr += avctx->
width;