32 unsigned int bytes_per_scanline,
int compressed)
38 while (i<bytes_per_scanline) {
40 value = bytestream2_get_byte(gb);
43 value = bytestream2_get_byte(gb);
45 while (i<bytes_per_scanline && run--)
58 for (i=0; i<pallen; i++)
59 *dst++ = 0xFF000000 | bytestream2_get_be24u(gb);
61 memset(dst, 0, (256 - pallen) *
sizeof(*dst));
68 int compressed, xmin, ymin, xmax, ymax,
ret;
69 unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes,
stride,
y, x,
73 if (avpkt->
size < 128)
78 if (bytestream2_get_byteu(&gb) != 0x0a || bytestream2_get_byteu(&gb) > 5) {
83 compressed = bytestream2_get_byteu(&gb);
84 bits_per_pixel = bytestream2_get_byteu(&gb);
85 xmin = bytestream2_get_le16u(&gb);
86 ymin = bytestream2_get_le16u(&gb);
87 xmax = bytestream2_get_le16u(&gb);
88 ymax = bytestream2_get_le16u(&gb);
92 if (xmax < xmin || ymax < ymin) {
101 nplanes = bytestream2_get_byteu(&gb);
102 bytes_per_line = bytestream2_get_le16u(&gb);
103 bytes_per_scanline = nplanes * bytes_per_line;
105 if (bytes_per_scanline < (w * bits_per_pixel * nplanes + 7) / 8) {
110 switch ((nplanes<<8) + bits_per_pixel) {
146 if (nplanes == 3 && bits_per_pixel == 8) {
147 for (y=0; y<h; y++) {
150 for (x=0; x<w; x++) {
151 ptr[3*x ] = scanline[x ];
152 ptr[3*x+1] = scanline[x+ bytes_per_line ];
153 ptr[3*x+2] = scanline[x+(bytes_per_line<<1)];
159 }
else if (nplanes == 1 && bits_per_pixel == 8) {
160 int palstart = avpkt->
size - 769;
162 for (y=0; y<h; y++, ptr+=
stride) {
164 memcpy(ptr, scanline, w);
171 if (bytestream2_get_byte(&gb) != 12) {
177 }
else if (nplanes == 1) {
180 for (y=0; y<h; y++) {
186 ptr[x] =
get_bits(&s, bits_per_pixel);
193 for (y=0; y<h; y++) {
196 for (x=0; x<w; x++) {
197 int m = 0x80 >> (x&7),
v = 0;
198 for (i=nplanes - 1; i>=0; i--) {
200 v += !!(scanline[i*bytes_per_line + (x>>3)] & m);
209 if (nplanes == 1 && bits_per_pixel == 8) {
212 }
else if (bits_per_pixel * nplanes == 1) {
215 }
else if (bits_per_pixel < 8) {