50 for (i = 0; i < 256; i++)
51 s->
palette[i] = bytestream2_get_le32u(&s->
gb);
75 int *x,
int width,
int linesize)
77 int remaining = width - *x;
79 int striplen =
FFMIN(count, remaining);
84 }
else if (pixel >= 0)
85 memset(*dst, pixel, striplen);
87 remaining -= striplen;
90 *dst += linesize -
width;
94 if (*dst >= dst_end)
goto exhausted;
96 if (*dst <= dst_end)
goto exhausted;
99 *x = width - remaining;
103 *x = width - remaining;
108 void *
data,
int *got_frame,
112 const int buf_size = avpkt->
size;
125 if (bytestream2_get_byte(&s->
gb) != 0x42) {
129 if (bytestream2_get_byte(&s->
gb)) {
138 #define OP(gb, pixel, count) \
139 op(&dst, dst_end, (gb), (pixel), (count), &s->x, avctx->width, s->frame.linesize[0])
141 int type = bytestream2_get_byte(&s->
gb);
145 if (
OP(type ?
NULL : &s->
gb, -1, count))
break;
148 count = bytestream2_get_byte(&s->
gb);
149 pixel = bytestream2_get_byte(&s->
gb);
150 if (
OP(
NULL, pixel, count))
break;
153 type = bytestream2_get_le16(&s->
gb);
154 count = type & 0x3FFF;
165 pixel = type == 3 ? bytestream2_get_byte(&s->
gb) : -1;
166 if (type == 1) count += 0x4000;
167 if (
OP(type == 2 ? &s->
gb :
NULL, pixel, count))
break;