56 for (i = 0; i < 256; i++)
57 s->
palette[i] = bytestream2_get_le32u(&s->
gb);
81 int *x,
int width,
int linesize)
83 int remaining = width - *x;
85 int striplen =
FFMIN(count, remaining);
90 }
else if (pixel >= 0)
91 memset(*dst, pixel, striplen);
93 remaining -= striplen;
96 *dst += linesize -
width;
100 if (*dst >= dst_end)
goto exhausted;
102 if (*dst <= dst_end)
goto exhausted;
105 *x = width - remaining;
109 *x = width - remaining;
114 void *
data,
int *got_frame,
118 const int buf_size = avpkt->
size;
129 if (bytestream2_get_byte(&s->
gb) != 0x42) {
133 if (bytestream2_get_byte(&s->
gb)) {
142 #define OP(gb, pixel, count) \
143 op(&dst, dst_end, (gb), (pixel), (count), &s->x, avctx->width, s->frame->linesize[0])
145 int type = bytestream2_get_byte(&s->
gb);
149 if (
OP(type ?
NULL : &s->
gb, -1, count))
break;
152 count = bytestream2_get_byte(&s->
gb);
153 pixel = bytestream2_get_byte(&s->
gb);
154 if (
OP(
NULL, pixel, count))
break;
157 type = bytestream2_get_le16(&s->
gb);
158 count = type & 0x3FFF;
169 pixel = type == 3 ? bytestream2_get_byte(&s->
gb) : -1;
170 if (type == 1) count += 0x4000;
171 if (
OP(type == 2 ? &s->
gb :
NULL, pixel, count))
break;