Mercurial > libavcodec.hg
comparison rle.c @ 4770:a6d1c26e8b6f libavcodec
cosmetic
author | michael |
---|---|
date | Tue, 03 Apr 2007 02:18:00 +0000 |
parents | 79db9e9df40a |
children | 7cd3ffe4897f |
comparison
equal
deleted
inserted
replaced
4769:79db9e9df40a | 4770:a6d1c26e8b6f |
---|---|
56 } | 56 } |
57 | 57 |
58 int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, int w, int8_t add, uint8_t xor) | 58 int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, int w, int8_t add, uint8_t xor) |
59 { | 59 { |
60 int count, x; | 60 int count, x; |
61 uint8_t *out; | 61 uint8_t *out = outbuf; |
62 | |
63 out = outbuf; | |
64 | 62 |
65 for(x = 0; x < w; x += count) { | 63 for(x = 0; x < w; x += count) { |
66 /* see if we can encode the next set of pixels with RLE */ | 64 /* see if we can encode the next set of pixels with RLE */ |
67 if((count = count_pixels(ptr, w-x, bpp, 1)) > 1) { | 65 if((count = count_pixels(ptr, w-x, bpp, 1)) > 1) { |
68 if(out + bpp + 1 > outbuf + out_size) return -1; | 66 if(out + bpp + 1 > outbuf + out_size) return -1; |