53 for (i = 0; i < 256; i++)
54 ((uint32_t*)s->
frame.
data[1])[i] = bytestream_get_le32(&buf);
74 static inline int op(uint8_t **dst,
const uint8_t *dst_end,
75 const uint8_t **buf,
const uint8_t *buf_end,
77 int *x,
int width,
int linesize)
79 int remaining = width - *x;
81 int striplen =
FFMIN(count, remaining);
83 striplen =
FFMIN(striplen, buf_end - *buf);
86 memcpy(*dst, *buf, striplen);
88 }
else if (pixel >= 0)
89 memset(*dst, pixel, striplen);
91 remaining -= striplen;
94 *dst += linesize -
width;
98 if (*dst >= dst_end)
goto exhausted;
100 if (*dst <= dst_end)
goto exhausted;
103 *x = width - remaining;
107 *x = width - remaining;
112 void *
data,
int *data_size,
116 const uint8_t *buf = avpkt->
data;
117 const int buf_size = avpkt->
size;
118 const uint8_t *buf_end = buf + buf_size;
119 uint8_t *dst, *dst_end;
129 if (buf[0] != 0x42) {
142 #define OP(buf, pixel, count) \
143 op(&dst, dst_end, (buf), buf_end, (pixel), (count), &s->x, avctx->width, s->frame.linesize[0])
145 int type = bytestream_get_byte(&buf);
149 if (
OP(type ?
NULL : &buf, -1, count))
break;
152 count = bytestream_get_byte(&buf);
153 pixel = bytestream_get_byte(&buf);
154 if (
OP(
NULL, pixel, count))
break;
157 type = bytestream_get_le16(&buf);
158 count = type & 0x3FFF;
169 pixel = type == 3 ? bytestream_get_byte(&buf) : -1;
170 if (type == 1) count += 0x4000;
171 if (
OP(type == 2 ? &buf :
NULL, pixel, count))
break;
173 }
while (buf + 1 < buf_end);