Lines Matching defs:pbc
52 static int sgi_rle_encode(PutByteContext *pbc, const uint8_t *src,
55 int val, count, x, start = bytestream2_tell_p(pbc);
67 if (bytestream2_get_bytes_left_p(pbc) < bpp * 2)
71 bytestream2_put(pbc, count);
72 bytestream2_put(pbc, val);
77 if (bytestream2_get_bytes_left_p(pbc) < bpp * (count + 1))
80 bytestream2_put(pbc, count + 0x80);
83 bytestream2_put(pbc, val);
90 return bytestream2_tell_p(pbc) - start;
98 PutByteContext pbc;
161 bytestream2_init_writer(&pbc, pkt->data, pkt->size);
164 bytestream2_put_be16(&pbc, SGI_MAGIC);
165 bytestream2_put_byte(&pbc, s->rle); /* RLE 1 - VERBATIM 0 */
166 bytestream2_put_byte(&pbc, bytes_per_channel);
167 bytestream2_put_be16(&pbc, dimension);
168 bytestream2_put_be16(&pbc, width);
169 bytestream2_put_be16(&pbc, height);
170 bytestream2_put_be16(&pbc, depth);
172 bytestream2_put_be32(&pbc, 0L); /* pixmin */
173 bytestream2_put_be32(&pbc, pixmax);
174 bytestream2_put_be32(&pbc, 0L); /* dummy */
178 bytestream2_put_byte(&pbc, 0L);
181 bytestream2_put_be32(&pbc, 0L);
185 bytestream2_put_byte(&pbc, 0L);
191 bytestream2_init_writer(&taboff_pcb, pbc.buffer, tablesize);
192 bytestream2_skip_p(&pbc, tablesize);
195 bytestream2_init_writer(&tablen_pcb, pbc.buffer, tablesize);
196 bytestream2_skip_p(&pbc, tablesize);
206 bytestream2_put_be32(&taboff_pcb, bytestream2_tell_p(&pbc));
219 length = sgi_rle_encode(&pbc, encode_buf, width,
239 bytestream2_put_byte(&pbc, in_buf[x]);
242 bytestream2_put_be16(&pbc, ((uint16_t *)in_buf)[x]);
244 bytestream2_put_le16(&pbc, ((uint16_t *)in_buf)[x]);
252 pkt->size = bytestream2_tell_p(&pbc);