51 for (i = 0; i < 256; i++)
52 s->
palette[i] = bytestream2_get_le32u(&s->
gb);
76 int *x,
int width,
int linesize)
78 int remaining = width - *x;
80 int striplen =
FFMIN(count, remaining);
85 }
else if (pixel >= 0)
86 memset(*dst, pixel, striplen);
88 remaining -= striplen;
91 *dst += linesize -
width;
95 if (*dst >= dst_end)
goto exhausted;
97 if (*dst <= dst_end)
goto exhausted;
100 *x = width - remaining;
104 *x = width - remaining;
109 void *
data,
int *got_frame,
113 const int buf_size = avpkt->
size;
126 if (bytestream2_get_byte(&s->
gb) != 0x42) {
130 if (bytestream2_get_byte(&s->
gb)) {
139 #define OP(gb, pixel, count) \
140 op(&dst, dst_end, (gb), (pixel), (count), &s->x, avctx->width, s->frame.linesize[0])
142 int type = bytestream2_get_byte(&s->
gb);
146 if (
OP(type ?
NULL : &s->
gb, -1, count))
break;
149 count = bytestream2_get_byte(&s->
gb);
150 pixel = bytestream2_get_byte(&s->
gb);
151 if (
OP(
NULL, pixel, count))
break;
154 type = bytestream2_get_le16(&s->
gb);
155 count = type & 0x3FFF;
166 pixel = type == 3 ? bytestream2_get_byte(&s->
gb) : -1;
167 if (type == 1) count += 0x4000;
168 if (
OP(type == 2 ? &s->
gb :
NULL, pixel, count))
break;