1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

change rle encoder to count up to 127, sgi does not support 128

Originally committed as revision 12631 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-03-30 17:27:58 +00:00
parent fe790f89e8
commit e516d3488a
2 changed files with 5 additions and 5 deletions

View File

@ -35,12 +35,12 @@ static int count_pixels(const uint8_t *start, int len, int bpp, int same)
const uint8_t *pos;
int count = 1;
for(pos = start + bpp; count < FFMIN(128, len); pos += bpp, count ++) {
for(pos = start + bpp; count < FFMIN(127, len); pos += bpp, count ++) {
if(same != !memcmp(pos-bpp, pos, bpp)) {
if(!same) {
/* if bpp == 1, then 0 1 1 0 is more efficiently encoded as a single
* raw block of pixels. for larger bpp, RLE is as good or better */
if(bpp == 1 && count + 1 < FFMIN(128, len) && *pos != *(pos+1))
if(bpp == 1 && count + 1 < FFMIN(127, len) && *pos != *(pos+1))
continue;
/* if RLE can encode the next block better than as a raw block,

View File

@ -58,9 +58,9 @@ c3a9f333ddebff6eae3f4360bad2de29 *./tests/data/b-libav02.bmp
./tests/data/b-libav%02d.tga CRC=0xf3a66ecf
f558eef0740c4b247f1eb17e1dbf7adf *./tests/data/b-libav02.tga
./tests/data/b-libav%02d.tiff CRC=0x25c06ecf
3076b16ac0c8a39a796e69944f6a40dc *./tests/data/b-libav02.tiff
./tests/data/b-libav%02d.sgi CRC=0x00000001
c6cab058a2b0a33ee843bd096b280075 *./tests/data/b-libav02.sgi
7211a09803f104e59196bc712a819e69 *./tests/data/b-libav02.tiff
./tests/data/b-libav%02d.sgi CRC=0x25c06ecf
50a1d8ca27813084e20b7ae0b8f9d663 *./tests/data/b-libav02.sgi
./tests/data/b-libav%02d.jpg CRC=0x62328baa
5d6c53e5297c4485e26c25e37885376f *./tests/data/b-libav02.jpg
b0a8c8063d81921db5d7c8f50a1cc454 *./tests/data/b-libav.wav