46 unsigned int bytes_per_scanline,
int compressed)
52 while (i<bytes_per_scanline) {
54 value = bytestream2_get_byte(gb);
57 value = bytestream2_get_byte(gb);
59 while (i<bytes_per_scanline && run--)
72 for (i=0; i<pallen; i++)
73 *dst++ = 0xFF000000 | bytestream2_get_be24u(gb);
75 memset(dst, 0, (256 - pallen) *
sizeof(*dst));
85 int compressed, xmin, ymin, xmax, ymax, ret;
86 unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes,
stride,
y, x,
90 if (avpkt->
size < 128)
95 if (bytestream2_get_byteu(&gb) != 0x0a || bytestream2_get_byteu(&gb) > 5) {
100 compressed = bytestream2_get_byteu(&gb);
101 bits_per_pixel = bytestream2_get_byteu(&gb);
102 xmin = bytestream2_get_le16u(&gb);
103 ymin = bytestream2_get_le16u(&gb);
104 xmax = bytestream2_get_le16u(&gb);
105 ymax = bytestream2_get_le16u(&gb);
109 if (xmax < xmin || ymax < ymin) {
118 nplanes = bytestream2_get_byteu(&gb);
119 bytes_per_line = bytestream2_get_le16u(&gb);
120 bytes_per_scanline = nplanes * bytes_per_line;
122 if (bytes_per_scanline < (w * bits_per_pixel * nplanes + 7) / 8) {
127 switch ((nplanes<<8) + bits_per_pixel) {
168 if (nplanes == 3 && bits_per_pixel == 8) {
169 for (y=0; y<h; y++) {
172 for (x=0; x<w; x++) {
173 ptr[3*x ] = scanline[x ];
174 ptr[3*x+1] = scanline[x+ bytes_per_line ];
175 ptr[3*x+2] = scanline[x+(bytes_per_line<<1)];
181 }
else if (nplanes == 1 && bits_per_pixel == 8) {
182 int palstart = avpkt->
size - 769;
184 for (y=0; y<h; y++, ptr+=
stride) {
186 memcpy(ptr, scanline, w);
193 if (bytestream2_get_byte(&gb) != 12) {
199 }
else if (nplanes == 1) {
202 for (y=0; y<h; y++) {
208 ptr[x] =
get_bits(&s, bits_per_pixel);
215 for (y=0; y<h; y++) {
218 for (x=0; x<w; x++) {
219 int m = 0x80 >> (x&7),
v = 0;
220 for (i=nplanes - 1; i>=0; i--) {
222 v += !!(scanline[i*bytes_per_line + (x>>3)] & m);
231 if (nplanes == 1 && bits_per_pixel == 8) {
234 }
else if (bits_per_pixel * nplanes == 1) {
237 }
else if (bits_per_pixel < 8) {