33 unsigned int bytes_per_scanline,
42 value = bytestream2_get_byte(gb);
45 value = bytestream2_get_byte(gb);
47 while (i < bytes_per_scanline && run--)
60 for (i = 0; i < pallen; i++)
61 *dst++ = 0xFF000000 | bytestream2_get_be24u(gb);
63 memset(dst, 0, (256 - pallen) *
sizeof(*dst));
71 int compressed, xmin, ymin, xmax, ymax;
73 unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes,
stride,
y, x,
77 if (avpkt->
size < 128)
82 if (bytestream2_get_byteu(&gb) != 0x0a || bytestream2_get_byteu(&gb) > 5) {
87 compressed = bytestream2_get_byteu(&gb);
88 bits_per_pixel = bytestream2_get_byteu(&gb);
89 xmin = bytestream2_get_le16u(&gb);
90 ymin = bytestream2_get_le16u(&gb);
91 xmax = bytestream2_get_le16u(&gb);
92 ymax = bytestream2_get_le16u(&gb);
96 if (xmax < xmin || ymax < ymin) {
105 nplanes = bytestream2_get_byteu(&gb);
106 bytes_per_line = bytestream2_get_le16u(&gb);
107 bytes_per_scanline = nplanes * bytes_per_line;
109 if (bytes_per_scanline < (w * bits_per_pixel * nplanes + 7) / 8 ||
115 switch ((nplanes << 8) + bits_per_pixel) {
150 if (nplanes == 3 && bits_per_pixel == 8) {
151 for (y = 0; y < h; y++) {
154 for (x = 0; x < w; x++) {
155 ptr[3 * x] = scanline[x];
156 ptr[3 * x + 1] = scanline[x + bytes_per_line];
157 ptr[3 * x + 2] = scanline[x + (bytes_per_line << 1)];
162 }
else if (nplanes == 1 && bits_per_pixel == 8) {
163 int palstart = avpkt->
size - 769;
165 if (avpkt->
size < 769) {
172 for (y = 0; y < h; y++, ptr += stride) {
174 memcpy(ptr, scanline, w);
181 if (bytestream2_get_byte(&gb) != 12) {
187 }
else if (nplanes == 1) {
190 for (y = 0; y < h; y++) {
195 for (x = 0; x < w; x++)
196 ptr[x] =
get_bits(&s, bits_per_pixel);
202 for (y = 0; y < h; y++) {
205 for (x = 0; x < w; x++) {
206 int m = 0x80 >> (x & 7),
v = 0;
207 for (i = nplanes - 1; i >= 0; i--) {
209 v += !!(scanline[i * bytes_per_line + (x >> 3)] & m);
218 if (nplanes == 1 && bits_per_pixel == 8) {
221 }
else if (bits_per_pixel * nplanes == 1) {
224 }
else if (bits_per_pixel < 8) {