30 for(pos = start + bpp; count <
FFMIN(127, len); pos += bpp, count ++) {
31 if(same != !memcmp(pos-bpp, pos, bpp)) {
35 if(bpp == 1 && count + 1 <
FFMIN(127, len) && *pos != *(pos+1))
50 int add_rep,
int xor_rep,
int add_raw,
int xor_raw)
55 for(x = 0; x < w; x +=
count) {
58 if(out + bpp + 1 > outbuf + out_size)
return -1;
59 *out++ = (count ^ xor_rep) + add_rep;
60 memcpy(out, ptr, bpp);
65 if(out + bpp*count >= outbuf + out_size)
return -1;
66 *out++ = (count ^ xor_raw) + add_raw;
68 memcpy(out, ptr, bpp * count);
int ff_rle_count_pixels(const uint8_t *start, int len, int bpp, int same)
Count up to 127 consecutive pixels which are either all the same or all differ from the previous and ...
Libavcodec external API header.
common internal and external API header
int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr, int bpp, int w, int add_rep, int xor_rep, int add_raw, int xor_raw)
RLE compress the row, with maximum size of out_size.